-
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.
* test packaging repo for deployment * dockerize main pipeline * dockerize and deploy model server * update pytest workflow to reflect refactored requirements * only test tests/ dir * containerize pipeline * change is_local -> filesystem * add make target for python venv setup * add more makefile targets * accept port from env var * remove expose from model server doccker file * hardcode default cloud run port * specify platform on make build + default to port in config * make pipeline worker image * fix Dockerfile for pipeline * move stages to home in pipeline worker Dockerfile * update datetime storing * test limit on model server -> max batch duration = 60 sec * higher throughput resources for faster dataflow runs * add setup and teardown calls to init and deduplicating data * update docs * test push model server bucket * rm double run of push-deploy * no need to install for docker builds * bump actions/checkout@4 * add similar job for pipeline worker * add publish make target * make dokcerhub username public, so the final image location is visible in the logs * refactor publish job to separate actions workflow * update version to first offical release
- Loading branch information
Showing
36 changed files
with
825 additions
and
105 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,55 @@ | ||
name: Build & Push Images to Google Artifact Registry | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Runs on push to the main branch | ||
pull_request: | ||
branches: | ||
- main # Runs on pull requests to the main branch | ||
|
||
|
||
env: | ||
PROJECT_ID: ${{ secrets.PROJECT_ID }} | ||
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }} | ||
WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | ||
MODEL_REGISTERY: ${{ secrets.MODEL_REGISTERY }} | ||
|
||
jobs: | ||
build-push-images: | ||
name: Build and Push Images | ||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Google Auth | ||
id: auth | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
token_format: 'access_token' | ||
project_id: ${{ env.PROJECT_ID }} | ||
service_account: ${{ env.SERVICE_ACCOUNT }} | ||
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} | ||
|
||
- name: Docker Auth | ||
id: docker-auth | ||
uses: 'docker/login-action@v1' | ||
with: | ||
username: 'oauth2accesstoken' | ||
password: '${{ steps.auth.outputs.access_token }}' | ||
registry: '${{ env.MODEL_REGISTERY }}' | ||
|
||
- name: Build and Push Model Server | ||
run: make build-push-model-server | ||
env: | ||
MODEL_REGISTERY: ${{ env.MODEL_REGISTERY }} | ||
|
||
- name: Build and Push Pipeline Worker | ||
run: make build-push-pipeline-worker | ||
env: | ||
MODEL_REGISTERY: ${{ env.MODEL_REGISTERY }} |
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,39 @@ | ||
name: Publish Latest Images to Docker Hub | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Runs on push to the main branch | ||
|
||
|
||
env: | ||
MODEL_REGISTERY: ${{ secrets.MODEL_REGISTERY }} | ||
DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
jobs: | ||
publish-model-server: | ||
name: Publish Latest Images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Docker Auth (Docker Hub) | ||
id: docker-auth-dockerhub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{env.DOCKERHUB_USERNAME}} | ||
password: ${{env.DOCKERHUB_TOKEN}} | ||
|
||
- name: Publish Latest Model Server Image | ||
run: make publish-latest-model-server | ||
env: | ||
MODEL_REGISTERY: ${{ env.MODEL_REGISTERY }} | ||
PUBLIC_MODEL_REGISTERY: docker.io/${{ env.DOCKERHUB_USERNAME }} | ||
|
||
- name: Publish Latest Pipeline Worker Image | ||
run: make publish-latest-pipeline-worker | ||
env: | ||
MODEL_REGISTERY: ${{ env.MODEL_REGISTERY }} | ||
PUBLIC_MODEL_REGISTERY: docker.io/${{ env.DOCKERHUB_USERNAME }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ plots/ | |
model/ | ||
hide/ | ||
table/ | ||
env.sh | ||
|
||
# Python basic ignores | ||
# Byte-compiled / optimized / DLL files | ||
|
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,16 @@ | ||
FROM apache/beam_python3.11_sdk | ||
|
||
COPY src/ /home/src/ | ||
COPY requirements/requirements.txt /home/requirements.txt | ||
COPY data/geo /home/data/geo | ||
|
||
WORKDIR /home | ||
|
||
# Install HDF5 using apt | ||
RUN apt-get update && apt-get install -y \ | ||
libhdf5-dev \ | ||
libsndfile1 \ | ||
gcc | ||
RUN pip install -r requirements.txt | ||
|
||
ENTRYPOINT ["python3", "src/pipeline.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM python:3.11-slim-bullseye | ||
|
||
COPY src/model_server.py /home/src/model_server.py | ||
COPY src/config.py /home/src/config.py | ||
COPY src/config/ /home/src/config/ | ||
COPY requirements/model-requirements.txt /home/requirements.txt | ||
|
||
WORKDIR /home | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
CMD [ "python", "src/model_server.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM apache/beam_python3.11_sdk | ||
|
||
COPY src/ /home | ||
COPY requirements/requirements.txt /home/requirements.txt | ||
COPY data/geo /home/data/geo | ||
|
||
WORKDIR /home | ||
|
||
# Install HDF5 using apt | ||
RUN apt-get update && apt-get install -y \ | ||
libhdf5-dev \ | ||
libsndfile1 \ | ||
gcc | ||
RUN pip install -r requirements.txt |
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
Oops, something went wrong.