Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACR, Workflow UX, gh act, azure batch automation #43

Merged
merged 66 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5892d23
Changes for CFA Azure ACR
jkislin Sep 18, 2024
96c64c9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 18, 2024
db86b6c
added to news.md
jkislin Sep 18, 2024
444b423
testing image on jk branch
jkislin Sep 20, 2024
5cfe5d3
update workflow name; resubmit job
jkislin Sep 20, 2024
4023f65
change runs-on to new cdcgov runner
jkislin Sep 20, 2024
4284511
removed unworking cache check
jkislin Sep 20, 2024
5c4ec10
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 20, 2024
9777717
azure batch scaffolding (maybe not necessary here)
jkislin Sep 21, 2024
5e351a9
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 21, 2024
b2e279f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 21, 2024
e955773
another attempt at cacheing and simplification; splitting the buiild/…
jkislin Sep 25, 2024
f4de2a6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 25, 2024
604069f
better github actions ux via build names
jkislin Sep 25, 2024
8403153
organized workflows for contributor/tester ux
jkislin Sep 25, 2024
5916318
removed cacheing and made names easier to read
jkislin Sep 25, 2024
e5071a7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 25, 2024
bfc8eed
comprehensive workflow renaming for ux/trackability
jkislin Sep 25, 2024
8a43469
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 25, 2024
21118f0
Merge branch 'main' of https://github.com/CDCgov/cfa-epinow2-pipeline…
jkislin Sep 25, 2024
4f9dbad
Explicit date casting in queries
zsusswein Sep 25, 2024
6745c57
Bump NEWS
zsusswein Sep 25, 2024
434b2e9
Merge branch 'zs-duckdb-update-bugfix' of https://github.com/CDCgov/c…
jkislin Sep 25, 2024
915fa76
pipeline with batch code - not yet working
jkislin Sep 25, 2024
285c8ae
Merge branch 'main' into jk-azure-readiness
jkislin Sep 25, 2024
1961bc2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 25, 2024
cd9b198
commenting out the job01 dependencies build to claw us back some test…
jkislin Sep 25, 2024
1161903
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 25, 2024
718d372
nektos gh-act tests and pool creation code
jkislin Sep 26, 2024
929fdff
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 26, 2024
9ad0060
fix some env variables for auto scale formula
jkislin Sep 26, 2024
52748bd
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 26, 2024
73efd5a
more cowbell
jkislin Sep 26, 2024
4aa8bdc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 26, 2024
d672938
fix needs issue
jkislin Sep 26, 2024
b4c21c1
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 26, 2024
ee0e5e9
we need quotes around var names"
jkislin Sep 26, 2024
21c70ca
autoscale formula as cat'd variable
jkislin Sep 26, 2024
f71a157
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 26, 2024
a0c3399
newline syntax fix for bash batch cli code
jkislin Sep 26, 2024
ba43234
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 26, 2024
62fb416
fixed endpoint uri
jkislin Sep 26, 2024
73360c7
autoscale enablement?;
jkislin Sep 26, 2024
914395b
autoscale as a separate step
jkislin Sep 26, 2024
2b30029
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 26, 2024
9211058
pool id var needs fixing in the last step
jkislin Sep 26, 2024
3194708
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 26, 2024
25d42c5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 26, 2024
aaf2a1a
environment variables
jkislin Sep 26, 2024
623ea45
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 26, 2024
aa7438f
quotes?
jkislin Sep 26, 2024
8c1bb0f
comments
jkislin Sep 26, 2024
dde360e
run name in quotes
jkislin Sep 26, 2024
2819567
Update .github/workflows/1-Build-Dependency-Image.yaml
jkislin Sep 27, 2024
a64e632
Update .gitignore
jkislin Sep 27, 2024
ea45737
added cron trigger and removed jk-azure-readiness push trigger
jkislin Sep 27, 2024
f82110a
documentation edits; file renames; revived "cacheing" for testing
jkislin Sep 27, 2024
ed939ad
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2024
22cc946
ubuntu image update?
jkislin Sep 27, 2024
dd1b777
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 27, 2024
f25af3e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2024
da7040c
node agent sku also...
jkislin Sep 27, 2024
203d661
Merge branch 'jk-azure-readiness' of https://github.com/CDCgov/cfa-ep…
jkislin Sep 27, 2024
3cd0126
attempting ubuntu 22 as 24 not yet supported
jkislin Sep 27, 2024
8355965
simplified commit message display in workflow gui
jkislin Sep 27, 2024
b5ebbf7
reverted to ubuntu 20. will have to investigate
jkislin Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Build Dependencies Container Image
run-name: (1) Dependencies Image Build - ${{ github.event.head_commit.message }} - ${{ github.ref_name }}

# This GitHub Actions workflow builds a Docker image for the
# cfa-epinow2-pipeline-docker project. It consists of two jobs:
# build_image_dependencies and build_image.
# This GitHub Actions workflow builds a Dependencies Docker image for the
# cfa-epinow2-pipeline-docker project.
#
# - The `build_image_dependencies` job carries out the first part of a
# multi-stage build. It downloads and installs all the dependencies
Expand All @@ -15,21 +14,15 @@ run-name: (1) Dependencies Image Build - ${{ github.event.head_commit.message }}
# The process is cached to avoid rebuilding the image if the dependencies
# have not changed. This is by hashing the `DESCRIPTION` file and the
# `Dockerfile-dependencies` file.
#
# - The build_image job builds the final image using the `Dockerfile` file.
# It uses the image built in the previous job as a base image.
#
# During the build process, the package is installed and built. Furthermore
# the package is checked using `R CMD check` to ensure that it is working
# correctly.
#
# Once the image is built, it is pushed to the corresponding registry.

# - This built docker image is then referenced by the simply named 'Dockerfile', built in:
# - "2_pre-Test-Model-Image-Build" and
# - "2-Run-Epinow2-Pipeline.yaml"

on:
push:
branches:
- main
- jk-azure-readiness # temporary
paths:
- "./Dockerfile-dependencies" # the dockerfile this workflow builds from
- "./.github/workflows/build-dependency-image.yaml" # this workflow
Expand All @@ -55,13 +48,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

# - name: Check cache
# uses: actions/cache@v3
# id: cache
# with:
# key: docker-dependencies-${{ runner.os }}-${{ hashFiles('./DESCRIPTION', './Dockerfile-dependencies') }}
# path:
# ./DESCRIPTION
- name: Check cache
uses: actions/cache@v3
id: cache
with:
key: docker-dependencies-${{ runner.os }}-${{ hashFiles('./DESCRIPTION', './Dockerfile-dependencies') }}
path:
./DESCRIPTION

- name: Login to the Container Registry
uses: docker/login-action@v3
Expand All @@ -70,9 +63,8 @@ jobs:
username: "cfaprdbatchcr"
password: ${{ secrets.CFAPRDBATCHCR_REGISTRY_PASSWORD }}

# if: steps.cache.outputs.cache-hit != 'true'

- name: Build and push
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/build-push-action@v6
with:
push: true
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/2-Run-Epinow2-Pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,17 @@ name: Run Epinow2 Pipeline
run-name: (2) Pipeline - "${{ github.event.head_commit.message }}" - ${{ github.ref_name }}

# This GitHub Actions workflow builds a Docker image for the
# cfa-epinow2-pipeline-docker project. It consists of two jobs:
# build_image_dependencies and build_image.
#
# - The `build_image_dependencies` job carries out the first part of a
# multi-stage build. It downloads and install all the dependencies
# listed in the `DESCRIPTION` file. It uses the `Dockerfile-dependencies`
# file to build the image.
#
# The built image is then pushed to the corresponding registry.
#
# The process is cached to avoid rebuilding the image if the dependencies
# have not changed. This is by hashing the `DESCRIPTION` file and the
# `Dockerfile-dependencies` file.
# cfa-epinow2-pipeline-docker project.
#
# - The build_image job builds the final image using the `Dockerfile` file.
# It uses the image built in the previous job as a base image.
# It uses the image built in "1-Build-Dependencies-Image.yaml" as a base image.
#
# During the build process, the package is installed and built. Furthermore
# the package is checked using `R CMD check` to ensure that it is working
# correctly.
#
# Once the image is built, it is pushed to the corresponding registry.


on:
push:
branches:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/2_pre-Test-Model-Image-Build.yaml
natemcintosh marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Model Image Build
run-name: (2_pre) Test Model Image - "${{ github.event.head_commit.message }}" - ${{ github.ref_name }}

# This GitHub Actions workflow builds a Docker image for the
# cfa-epinow2-pipeline-docker project. In-container tests can be added here.

on:
pull_request:
branches:
- main
workflow_dispatch:
schedule:
# Tuesdays at noon GMT time, 24 hours before the prod container is built and deployed
- cron: "0 12 * * 2"

env:
# Together, these form: cfaprdbatchcr.azurecr.io/cfa-epinow2-pipeline
REGISTRY: cfaprdbatchcr.azurecr.io
IMAGE_NAME: cfa-epinow2-pipeline

jobs:

_01_build-model-image:
runs-on: cfa-cdcgov
steps:

- name: Login to the Container Registry
uses: docker/login-action@v3
with:
registry: "cfaprdbatchcr.azurecr.io"
username: "cfaprdbatchcr"
password: ${{ secrets.CFAPRDBATCHCR_REGISTRY_PASSWORD }}

- name: Build and push model pipeline image for Azure batch
id: build_and_push_model_image
uses: docker/build-push-action@v6
with:
push: false # This can be toggled manually for tweaking.
tags: |
${{ env.REGISTRY}}/${{ env.IMAGE_NAME }}:buildtest-latest
${{ env.REGISTRY}}/${{ env.IMAGE_NAME }}:buildtest-${{ github.sha }}
file: ./Dockerfile
Loading