Skip to content

cleanup: remove all legacy dagster deployment code #300

cleanup: remove all legacy dagster deployment code

cleanup: remove all legacy dagster deployment code #300

---
name: Validate Github Actions
on:
pull_request:
paths:
- Dockerfile
- src/**
- Pipfile
- Pipfile.lock
- actions/**
- mpyl_config.example.yml
- tests/test_resources/changed-files-actions/*
# If multiple commits are pushed simultaneously, only build the last one.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: false
jobs:
changed-files:
name: 📋 Do we need to build?
runs-on: ubuntu-latest
outputs:
build-docker-image: ${{ steps.changed-files.outputs.any_changed == 'true' }}
steps:
- uses: tj-actions/[email protected]
id: changed-files
with:
files: |-
Dockerfile
src/**
Pipfile
Pipfile.lock
docker:
name: 🐳 Build & publish Docker image
runs-on: ubuntu-latest
needs: changed-files
if: needs.changed-files.outputs.build-docker-image == 'true'
outputs:
image: ${{ steps.docker-image.outputs.image-with-sha }}
steps:
- uses: actions/[email protected]
- name: Configure AWS credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/[email protected]
with:
registry-type: public
- name: Create repository in ECR
uses: int128/[email protected]
with:
repository: gh-mpyl
public: true
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Compute Docker image
run: |-
echo "image=$REGISTRY/$REPOSITORY/$PROJECT:$VERSION" | tee -a "$GITHUB_OUTPUT"
echo "image-with-sha=$REGISTRY/$REPOSITORY/$PROJECT:$VERSION.$SHA" | tee -a "$GITHUB_OUTPUT"
id: docker-image
env:
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
REPOSITORY: ${{ vars.AWS_ECR_PUBLIC_ALIAS }}
PROJECT: gh-mpyl
VERSION: pr-${{ github.event.pull_request.number }}
SHA: ${{ github.sha }}
- name: Build and push
id: docker-build-push
uses: docker/[email protected]
with:
file: Dockerfile
context: .
tags: |-
${{ steps.docker-image.outputs.image }}
${{ steps.docker-image.outputs.image-with-sha }}
platforms: |-
linux/amd64
linux/arm64
provenance: false
push: true
health-check:
name: ▶️ Run actions/health-check
runs-on: ubuntu-latest
if: ${{ !failure() && !cancelled() }}
needs:
- changed-files
- docker
steps:
- uses: actions/[email protected]
- name: Point action.yaml to the Docker image built in the previous job
if: needs.changed-files.outputs.build-docker-image == 'true'
env:
IMAGE: docker://${{ needs.docker.outputs.image }}
run: yq -i '.runs.image = strenv(IMAGE)' actions/health-check/action.yaml
- uses: ./actions/health-check
with:
config-path: mpyl_config.example.yml
lint-projects:
name: ▶️ Run actions/lint-projects
runs-on: ubuntu-latest
if: ${{ !failure() && !cancelled() }}
needs:
- changed-files
- docker
steps:
- uses: actions/[email protected]
- name: Point action.yaml to the Docker image built in the previous job
if: needs.changed-files.outputs.build-docker-image == 'true'
env:
IMAGE: docker://${{ needs.docker.outputs.image }}
run: yq -i '.runs.image = strenv(IMAGE)' actions/lint-projects/action.yaml
- uses: ./actions/lint-projects
with:
config-path: mpyl_config.example.yml
discover-run-plan:
name: ▶️ Run actions/discover-run-plan
runs-on: ubuntu-latest
if: ${{ !failure() && !cancelled() }}
needs:
- changed-files
- docker
steps:
- uses: actions/[email protected]
- name: Point action.yaml to the Docker image built in the previous job
if: needs.changed-files.outputs.build-docker-image == 'true'
env:
IMAGE: docker://${{ needs.docker.outputs.image }}
run: yq -i '.runs.image = strenv(IMAGE)' actions/discover-run-plan/action.yaml
- name: Discover run plan based on changed files
uses: ./actions/discover-run-plan
with:
changed-files-path: tests/test_resources/changed-files-actions
config-path: mpyl_config.example.yml
- name: Discover run plan based on changed files with manual sub-select
uses: ./actions/discover-run-plan
with:
selected-project: job
changed-files-path: tests/test_resources/changed-files-actions
config-path: mpyl_config.example.yml
generate-kubernetes-manifests:
name: ▶️ Run actions/generate-kubernetes-manifests
runs-on: ubuntu-latest
if: ${{ !failure() && !cancelled() }}
needs:
- changed-files
- docker
steps:
- uses: actions/[email protected]
- name: Point action.yaml to the Docker image built in the previous job
if: needs.changed-files.outputs.build-docker-image == 'true'
env:
IMAGE: docker://${{ needs.docker.outputs.image }}
run: |-
yq -i '.runs.image = strenv(IMAGE)' actions/discover-run-plan/action.yaml
yq -i '.runs.image = strenv(IMAGE)' actions/generate-kubernetes-manifests/action.yaml
- uses: ./actions/discover-run-plan
with:
changed-files-path: tests/test_resources/changed-files-actions
config-path: mpyl_config.example.yml
- uses: ./actions/generate-kubernetes-manifests
with:
project: job
environment: pull-request
version: a-random-version
deploy-image: a-random-docker-image
config-path: mpyl_config.example.yml