-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setup CI/CD process around the se-demos-dev workspace (#85) * cicd tests * cicd tests2 * cicd tests3 * cicd tests4 * cicd tests5 * cicd tests5 * cicd tests6 * cicd tests7 * cicd tests8 * cicd tests9 * cicd dev branch * cicd dev branch2 * formatting consistency * setup dev vs demo workpools in CI * Dev ci/cd (#86) * cicd tests * cicd tests2 * cicd tests3 * cicd tests4 * cicd tests5 * cicd tests5 * cicd tests6 * cicd tests7 * cicd tests8 * cicd tests9 * cicd dev branch * cicd dev branch2 * formatting consistency * setup dev vs demo workpools in CI * remove extra env variable * Adds a basic CI template to use for new projects/demos to the dev branch (#88) * remove extra workspace env variable * specifiy name on datalake ci job * specifiy name on datalake ci job2 * initial ci template for new projects * syntax edits * move workflow template * ci image templating * use correct branch name for Dev ci process (#89) * update ci env syntax (#90) * update name in GHA (#91) * remove Project Name env (#92) * Update README.md (#93) * remove legacy demos (#94) --------- Co-authored-by: Jeff Hale <[email protected]>
- Loading branch information
1 parent
45b5c22
commit ea77ff8
Showing
20 changed files
with
102 additions
and
1,021 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
### Reference template for building new ci processes for | ||
### new demo projects within the demos repo. | ||
### Each demo project should be relatively self-contained | ||
### within it's own project directory barring external requirements | ||
### i.e. workpools or shared resources. | ||
|
||
name: Build image and deploy Prefect flow - PROJECT_NAME | ||
|
||
env: | ||
PROJECT_DIRECTTORY: flows/PATH/TO/PROJECT | ||
PROD_WORKPOOL: PROD_WORKPOOL_NAME # Preconfigured workpool in the se-demos workspace | ||
DEV_WORKPOOL: DEV_WORKPOOL_NAME # Preconfigured workpool in the se-demos-dev workspace | ||
CLOUD_ENV: AWS # AWS, GCP, AZURE | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- Dev | ||
paths: | ||
- "$PROJECT_DIRECTORY/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy PROJECT_NAME flows | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
# Appropriate secrets should be set as github secrets | ||
# to be referenced here defaults to AWS ECR REPO | ||
- name: Log in to image registry | ||
uses: docker/login-action@v3 | ||
if: env.CLOUD_ENV == 'AWS' | ||
with: | ||
registry: ${{ secrets.ECR_REPO }} | ||
username: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
- name: Get commit hash | ||
id: get-commit-hash | ||
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
|
||
- name: Prefect Deploy | ||
# ENV variables to reference in deploy.py script | ||
env: | ||
BRANCH: ${{ github.ref_name }} | ||
GITHUB_SHA: ${{ steps.get-commit-hash.outputs.COMMIT_HASH }} | ||
PREFECT_API_KEY: ${{ secrets.PREFECT_API_KEY }} | ||
IMG_REPO: ${{ secrets.ECR_REPO }} # IMAGE REGISTRY SECRET should be referenced here | ||
WORKSPACE: ${{ github.ref == 'refs/heads/main' && 'se-demos' || 'se-demos-dev' }} | ||
WORK_POOL_NAME: ${{ github.ref == 'refs/heads/main' && env.PROD_WORKPOOL || env.DEV_WORKPOOL }} | ||
SCHEDULES_ACTIVE: ${{ github.ref == 'refs/heads/main' && True || False }} | ||
run: | | ||
cd $PROJECT_DIRECTORY | ||
pip install -r requirements-ci.txt | ||
prefect cloud workspace set -w sales-engineering/$WORKSPACE | ||
python deploy.py | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.