From f1b8efbad20d3fc224c4e8782965fd147e1cc1c2 Mon Sep 17 00:00:00 2001 From: iyoubee Date: Fri, 7 Jun 2024 09:00:13 +0700 Subject: [PATCH] au ah --- .github/workflows/deploy.yml | 180 +++++++++++++++++------------------ requirements.txt | Bin 2080 -> 2064 bytes 2 files changed, 90 insertions(+), 90 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 02f68b0..f02d7d0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,90 +1,90 @@ -name: Deploy to GCE - -env: - APP_NAME: ulascan-ml - GCE_INSTANCE_IP: ${{ secrets.GCE_INSTANCE_IP }} - GCE_INSTANCE_NAME: ${{ secrets.GCE_INSTANCE_NAME }} - GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} - GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} - GCP_REGION: ${{ secrets.GCP_REGION }} - GCP_ZONE: ${{ secrets.GCP_ZONE }} - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip install requests tqdm - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 - with: - credentials_json: ${{ secrets.GCP_SA_KEY }} - - - name: Set up Google Cloud SDK - uses: google-github-actions/setup-gcloud@v1 - with: - project_id: ${{ secrets.GCP_PROJECT_ID }} - - - name: Configure docker for Artifact Registry - run: | - gcloud --quiet auth configure-docker $GCP_REGION-docker.pkg.dev - - # - name: Run file download script - # run: python download.py - - - name: Build and push Docker image - run: | - docker build -t $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest . - docker push $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest - - # deploy: - # needs: build - # runs-on: ubuntu-latest - - # steps: - # - name: Install SSH client - # run: sudo apt-get install -y ssh - - # - name: Set up SSH - # run: | - # echo "$SSH_PRIVATE_KEY" > ssh_key - # chmod 600 ssh_key - - # - name: Deploy to GCE - # run: | - # ssh -o StrictHostKeyChecking=no \ - # -i ssh_key \ - # ulascan@$GCE_INSTANCE_IP \ - # "gcloud --quiet auth configure-docker $GCP_REGION-docker.pkg.dev \ - # && docker pull $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest \ - # && docker stop $APP_NAME || true \ - # && docker rm --force $APP_NAME || true \ - # && docker run -d \ - # --name $APP_NAME \ - # -p 5000:5000 \ - # $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest \ - # && docker image prune -f" - - # - name: Cleanup SSH key - # run: rm ssh_key +# name: Deploy to GCE + +# env: +# APP_NAME: ulascan-ml +# GCE_INSTANCE_IP: ${{ secrets.GCE_INSTANCE_IP }} +# GCE_INSTANCE_NAME: ${{ secrets.GCE_INSTANCE_NAME }} +# GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} +# GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} +# GCP_REGION: ${{ secrets.GCP_REGION }} +# GCP_ZONE: ${{ secrets.GCP_ZONE }} +# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + +# on: +# push: +# branches: +# - main + +# jobs: +# build: +# runs-on: ubuntu-latest + +# steps: +# - name: Checkout code +# uses: actions/checkout@v2 + +# - name: Set up Python +# uses: actions/setup-python@v2 +# with: +# python-version: '3.x' + +# - name: Install python dependencies +# run: | +# python -m pip install --upgrade pip +# pip install requests tqdm + +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v1 + +# - name: Authenticate to Google Cloud +# uses: google-github-actions/auth@v1 +# with: +# credentials_json: ${{ secrets.GCP_SA_KEY }} + +# - name: Set up Google Cloud SDK +# uses: google-github-actions/setup-gcloud@v1 +# with: +# project_id: ${{ secrets.GCP_PROJECT_ID }} + +# - name: Configure docker for Artifact Registry +# run: | +# gcloud --quiet auth configure-docker $GCP_REGION-docker.pkg.dev + +# - name: Run file download script +# run: python download.py + +# - name: Build and push Docker image +# run: | +# docker build -t $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest . +# docker push $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest + +# deploy: +# needs: build +# runs-on: ubuntu-latest + +# steps: +# - name: Install SSH client +# run: sudo apt-get install -y ssh + +# - name: Set up SSH +# run: | +# echo "$SSH_PRIVATE_KEY" > ssh_key +# chmod 600 ssh_key + +# - name: Deploy to GCE +# run: | +# ssh -o StrictHostKeyChecking=no \ +# -i ssh_key \ +# ulascan@$GCE_INSTANCE_IP \ +# "gcloud --quiet auth configure-docker $GCP_REGION-docker.pkg.dev \ +# && docker pull $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest \ +# && docker stop $APP_NAME || true \ +# && docker rm --force $APP_NAME || true \ +# && docker run -d \ +# --name $APP_NAME \ +# -p 5000:5000 \ +# $GCP_REGION-docker.pkg.dev/$GCP_PROJECT_ID/ulascan/$APP_NAME:latest \ +# && docker image prune -f" + +# - name: Cleanup SSH key +# run: rm ssh_key diff --git a/requirements.txt b/requirements.txt index f36cf31422b9fcb7dd10494f3be1a183f50731f0..7a5d41028b6f79a5f06a1a0fe51b78059fdae5bf 100644 GIT binary patch delta 16 XcmZ1=FhO8L8QbI_Hkr+f*y