FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
git workflow update
tilakpatel2231b1cc2ba80a
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.ymlindex 78240f9dd..5a93134ca 100644--- a/.github/workflows/docker-image.yml+++ b/.github/workflows/docker-image.yml@@ -2,7 +2,7 @@ name: Docker Image CIon:push:- branches: [ "main" ]+ branches: [ "main", "develop" ]pull_request:branches: [ "main" ]workflow_dispatch: # Allow manual triggering@@ -17,13 +17,26 @@ jobs:permissions:contents: readpackages: write+ security-events: write # For security scanningsteps:- name: Checkout repositoryuses: actions/checkout@v4+ - name: Free up disk space+ run: |+ sudo rm -rf /usr/local/lib/android+ sudo rm -rf /usr/share/dotnet+ sudo rm -rf /opt/ghc+ sudo rm -rf /usr/local/share/boost+ sudo apt-get clean+ docker system prune -af+- name: Set up Docker Buildxuses: docker/setup-buildx-action@v3+ with:+ driver-opts: |+ network=host- name: Log in to Container Registryif: github.event_name != 'pull_request'@@ -48,13 +61,37 @@ jobs:uses: docker/build-push-action@v5with:context: .- file: ./Dockerfile+ file: ./Dockerfile.optimizedpush: ${{ github.event_name != 'pull_request' }}tags: ${{ steps.meta.outputs.tags }}labels: ${{ steps.meta.outputs.labels }}cache-from: type=ghacache-to: type=gha,mode=max- platforms: linux/amd64,linux/arm64+ platforms: linux/amd64+ build-args: |+ BUILDKIT_INLINE_CACHE=1++ - name: Image size check+ if: github.event_name != 'pull_request'+ run: |+ # Get the latest tag for size checking+ LATEST_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"+ docker pull $LATEST_TAG+ IMAGE_SIZE=$(docker images $LATEST_TAG --format "table {{.Size}}" | tail -n +2)+ echo "Final image size: $IMAGE_SIZE"++ # Convert size to MB for comparison (rough estimation)+ if echo $IMAGE_SIZE | grep -q "GB"; then+ SIZE_NUM=$(echo $IMAGE_SIZE | sed 's/GB.*//')+ if (( $(echo "$SIZE_NUM > 2" | bc -l) )); then+ echo "Warning: Image size ($IMAGE_SIZE) is larger than 2GB"+ echo "Consider further optimization"+ else+ echo "Image size is acceptable: $IMAGE_SIZE"+ fi+ else+ echo "Image size is acceptable: $IMAGE_SIZE"+ fitest:runs-on: ubuntu-latest@@ -65,6 +102,12 @@ jobs:- name: Checkout repositoryuses: actions/checkout@v4+ - name: Free up disk space+ run: |+ sudo rm -rf /usr/local/lib/android+ sudo rm -rf /usr/share/dotnet+ docker system prune -af+- name: Set up Docker Buildxuses: docker/setup-buildx-action@v3@@ -72,15 +115,61 @@ jobs:uses: docker/build-push-action@v5with:context: .- file: ./Dockerfile+ file: ./Dockerfile.optimizedload: truetags: test-image:latestcache-from: type=gha- - name: Test Docker image+ - name: Test Docker image basic functionality+ run: |+ echo "Testing if optimized container starts successfully..."+ docker run --rm test-image:latest python -c "+ import sys+ print('Python version:', sys.version)+ print('Container test passed!')++ # Test core imports that should be available+ try:+ import pandas as pd+ import numpy as np+ import requests+ print('Core dependencies imported successfully')+ except ImportError as e:+ print('Import failed:', e)+ sys.exit(1)+ "++ - name: Test application structurerun: |- echo "Testing if container starts successfully..."- docker run --rm test-image:latest python -c "print('Container test passed!')"+ echo "Testing application structure..."+ docker run --rm test-image:latest python -c "+ import sys+ import os++ # Check if application files exist+ app_files = [+ '/app/fincept_terminal',+ '/app/pyproject.toml'+ ]++ for file_path in app_files:+ if os.path.exists(file_path):+ print(f'{file_path} exists')+ else:+ print(f'{file_path} not found')++ # Test virtual environment+ if os.path.exists('/app/.venv'):+ print('Virtual environment found')+ else:+ print('Virtual environment not found')+ "++ - name: Check final image size+ run: |+ SIZE=$(docker images test-image:latest --format "table {{.Size}}" | tail -n +2)+ echo "Final optimized image size: $SIZE"+ echo "size=$SIZE" >> $GITHUB_OUTPUTsecurity-scan:runs-on: ubuntu-latest@@ -91,7 +180,7 @@ jobs:- name: Run Trivy vulnerability scanneruses: aquasecurity/trivy-action@masterwith:- image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}+ image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latestformat: 'sarif'output: 'trivy-results.sarif'@@ -99,4 +188,30 @@ jobs:uses: github/codeql-action/upload-sarif@v3if: always()with:- sarif_file: 'trivy-results.sarif'\ No newline at end of file+ sarif_file: 'trivy-results.sarif'++ notify:+ runs-on: ubuntu-latest+ needs: [build, security-scan]+ if: always() && github.event_name != 'pull_request'++ steps:+ - name: Build Status Summary+ run: |+ echo "## Docker Build Summary" >> $GITHUB_STEP_SUMMARY+ echo "" >> $GITHUB_STEP_SUMMARY+ echo "| Component | Status |" >> $GITHUB_STEP_SUMMARY+ echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY+ echo "| Build | ${{ needs.build.result == 'success' && 'Success' || 'Failed' }} |" >> $GITHUB_STEP_SUMMARY+ echo "| Security Scan | ${{ needs.security-scan.result == 'success' && 'Passed' || 'Issues Found' }} |" >> $GITHUB_STEP_SUMMARY+ echo "" >> $GITHUB_STEP_SUMMARY+ echo "### Usage:" >> $GITHUB_STEP_SUMMARY+ echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY+ echo "# Pull the optimized image" >> $GITHUB_STEP_SUMMARY+ echo "docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_STEP_SUMMARY+ echo "" >> $GITHUB_STEP_SUMMARY+ echo "# Run the container" >> $GITHUB_STEP_SUMMARY+ echo "docker run -p 8000:8000 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_STEP_SUMMARY+ echo "\`\`\`" >> $GITHUB_STEP_SUMMARY+ echo "" >> $GITHUB_STEP_SUMMARY+ echo "Expected image size: 800MB-1.2GB (down from 10GB)" >> $GITHUB_STEP_SUMMAR\ No newline at end of file