diff --git a/.github/workflows/quickdeploy.yml b/.github/workflows/quickdeploy.yml deleted file mode 100644 index f67582b6..00000000 --- a/.github/workflows/quickdeploy.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Quick Deploy Test -on: - workflow_dispatch: - -permissions: - id-token: write - contents: read - issues: write - pull-requests: write - -jobs: - deploy-test: - name: Deploy [TEST] - runs-on: ubuntu-latest - environment: test - if: github.event_name == 'workflow_dispatch' - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Get pip cache dir - id: pip-cache - run: | - python -m pip install pip --upgrade - echo "PIP_CACHE_DIR=$(python -m pip cache dir)" >> $GITHUB_ENV - - - name: Cache pip - uses: actions/cache@v2 - with: - path: ${{ env.PIP_CACHE_DIR }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Configure GCP Credentials - uses: "google-github-actions/auth@v0" - with: - workload_identity_provider: "projects/734798842681/locations/global/workloadIdentityPools/my-pool/providers/gh-provider" - service_account: "git-cerulean-cloud@cerulean-338116.iam.gserviceaccount.com" - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: arn:aws:iam::162277344632:role/CeruleanCloudDeploy - aws-region: eu-central-1 - - - name: Configure docker - run: gcloud auth configure-docker -q - - - run: pip install -r requirements.txt - # - uses: pulumi/actions@v3 - # id: pulumi-images - # env: - # PULUMI_CONFIG_PASSPHRASE: "test" - # with: - # work-dir: images/ - # command: up - # stack-name: test - - # Copy shared database_client.py files - - name: Copy Shared File - run: | - mkdir -p cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/ - cp cerulean_cloud/database_client.py cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/database_client.py - cp cerulean_cloud/database_schema.py cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/database_schema.py - - - uses: pulumi/actions@v3 - id: pulumi - env: - PULUMI_CONFIG_PASSPHRASE: "test" - MODEL: ${{ steps.pulumi-images.outputs.model }} - with: - command: up - stack-name: test - - - uses: wagnerpereira/gce-cloudsql-proxy-action@v2 - with: - instance: ${{ steps.pulumi.outputs.database_instance_name }} - - # - name: Run database migrations - # env: - # DB_URL: ${{ steps.pulumi.outputs.database_url_alembic }} - # run: alembic upgrade head diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 4379a22e..b8d8a229 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -162,6 +162,7 @@ jobs: mkdir -p cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/ cp cerulean_cloud/database_client.py cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/database_client.py cp cerulean_cloud/database_schema.py cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/database_schema.py + cp cerulean_cloud/__init__.py cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/__init__.py - uses: pulumi/actions@v3 id: pulumi diff --git a/stack/__main__.py b/stack/__main__.py index 3fa8c4c8..15660be4 100644 --- a/stack/__main__.py +++ b/stack/__main__.py @@ -27,6 +27,6 @@ "scene_relevancy_url", cloud_function_scene_relevancy.fxn.https_trigger_url ) pulumi.export("historical_run_url", cloud_function_historical_run.fxn.https_trigger_url) -# pulumi.export("ais_analysis_url", cloud_function_ais_analysis.fxn.https_trigger_url) +pulumi.export("ais_analysis_url", cloud_function_ais_analysis.fxn.https_trigger_url) pulumi.export("sns_topic_subscription", sns_subscription.sentinel1_sqs_target.arn) pulumi.export("api_key", pulumi.Config("cerulean-cloud").require("apikey")) diff --git a/stack/cloud_function_ais_analysis.py b/stack/cloud_function_ais_analysis.py index 28f78d25..6e08d12b 100644 --- a/stack/cloud_function_ais_analysis.py +++ b/stack/cloud_function_ais_analysis.py @@ -95,13 +95,13 @@ service_account_email=cloud_function_service_account.email, ) -# invoker = cloudfunctions.FunctionIamMember( -# construct_name("cloud-function-ais-invoker"), -# project=fxn.project, -# region=fxn.region, -# cloud_function=fxn.name, -# role="roles/cloudfunctions.invoker", -# member="allUsers", -# ) +invoker = cloudfunctions.FunctionIamMember( + construct_name("cloud-function-ais-invoker"), + project=fxn.project, + region=fxn.region, + cloud_function=fxn.name, + role="roles/cloudfunctions.invoker", + member="allUsers", +) -# config_values["FUNCTION_URL"] = fxn.https_trigger_url +config_values["FUNCTION_URL"] = fxn.https_trigger_url