Skip to content

Commit

Permalink
s3 improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingrismore committed Mar 5, 2024
1 parent a9efb9a commit 3b95165
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/project-1-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
name: Deploy to staging
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/stg'
env:
ENVIRONMENT: stg

steps:
- name: Checkout
Expand Down Expand Up @@ -66,6 +68,8 @@ jobs:
name: Deploy to production
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
env:
ENVIRONMENT: prod

steps:
- name: Checkout
Expand Down Expand Up @@ -107,6 +111,7 @@ jobs:
PREFECT_API_KEY: ${{ secrets.PREFECT_API_KEY }}
IMAGE_NAME: ${{ steps.build-docker-image.outputs.metadata.image.name }}
run: |
pip install -r $PROJECT_NAME/requirements.txt
cd $PROJECT_NAME
pip install -r requirements.txt
prefect cloud workspace set -w sales-engineering/sandbox-kevin
prefect deploy --all --prefect-file $PROJECT_NAME/prefect.yaml
prefect deploy --all --prefect-file prefect.yaml
9 changes: 7 additions & 2 deletions .github/workflows/project-2-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
name: Deploy to staging
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/stg'
env:
ENVIRONMENT: stg

steps:
- name: Checkout
Expand Down Expand Up @@ -66,6 +68,8 @@ jobs:
name: Deploy to production
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
env:
ENVIRONMENT: prod

steps:
- name: Checkout
Expand Down Expand Up @@ -107,6 +111,7 @@ jobs:
PREFECT_API_KEY: ${{ secrets.PREFECT_API_KEY }}
IMAGE_NAME: ${{ steps.build-docker-image.outputs.metadata.image.name }}
run: |
pip install -r $PROJECT_NAME/requirements.txt
cd $PROJECT_NAME
pip install -r requirements.txt
prefect cloud workspace set -w sales-engineering/sandbox-kevin
prefect deploy --all --prefect-file $PROJECT_NAME/prefect.yaml
prefect deploy --all --prefect-file prefect.yaml
6 changes: 3 additions & 3 deletions project_1/prefect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ push:
- prefect_aws.deployments.steps.push_to_s3:
requires: prefect-aws
bucket: cicd-example-workspaces
folder: "{{ $PROJECT_NAME }}"
folder: "{{ $PROJECT_NAME }}_{{ $ENVIRONMENT }}"
credentials: "{{ prefect.blocks.aws-credentials.ecs-worker-changes }}"

pull:
- prefect_aws.deployments.steps.pull_from_s3:
requires: prefect-aws
bucket: cicd-example-workspaces
folder: "{{ $PROJECT_NAME }}"
folder: "{{ $PROJECT_NAME }}_{{ $ENVIRONMENT }}"
credentials: "{{ prefect.blocks.aws-credentials.ecs-worker-changes }}"

deployments:
- name: my-project-1-deployment
entrypoint: "{{ $PROJECT_NAME }}/flow.py:hello"
entrypoint: "{{ $PROJECT_NAME }}_{{ $ENVIRONMENT}}/flow.py:hello"
work_pool:
name: k8s-demo
work_queue_name: default
Expand Down
6 changes: 3 additions & 3 deletions project_2/prefect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ push:
- prefect_aws.deployments.steps.push_to_s3:
requires: prefect-aws
bucket: cicd-example-workspaces
folder: "{{ $PROJECT_NAME }}"
folder: "{{ $PROJECT_NAME }}_{{ $ENVIRONMENT }}"
credentials: "{{ prefect.blocks.aws-credentials.ecs-worker-changes }}"

pull:
- prefect_aws.deployments.steps.pull_from_s3:
requires: prefect-aws
bucket: cicd-example-workspaces
folder: "{{ $PROJECT_NAME }}"
folder: "{{ $PROJECT_NAME }}_{{ $ENVIRONMENT }}"
credentials: "{{ prefect.blocks.aws-credentials.ecs-worker-changes }}"

deployments:
- name: my-project-2-deployment
entrypoint: "{{ $PROJECT_NAME }}/flow.py:hello"
entrypoint: "{{ $PROJECT_NAME }}_{{ $ENVIRONMENT}}/flow.py:hello"
work_pool:
name: k8s-demo
work_queue_name: default
Expand Down

0 comments on commit 3b95165

Please sign in to comment.