Craft pattern dev #270
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
name: CI/CD for BERT-based sentence classification models | |
# ########################################################################### # | |
# # | |
# This workflow trains BERT-based models for sentence classification. # | |
# Changes in training data files as well as relevant Docker-related files # | |
# automatically trigger new builds/training for the appropriate model. # | |
# # | |
# --- Changes to base.Docker will trigger a rebuild of the base container # | |
# and all downstream containers. # | |
# # | |
# --- Changes to train.Dockerfile will trigger a rebuild of all training # | |
# containers and all downstream containers. # | |
# # | |
# --- Changes to predict.Dockerfile will trigger a rebuild of all prediction # | |
# containers. # | |
# # | |
# --- Changes to the data.tsv file in the data/ directories will trigger # | |
# rebuilds for the appropriate model-specific training and downstream # | |
# containers. # | |
# # | |
# ########################################################################### # | |
on: | |
# Trigger the workflow on push or pull request, | |
# but only for the main branch | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
PROJECT_ID: ${{ secrets.GCE_PROJECT }} | |
GCS_SERVICE_ACCOUNT: ${{ secrets.GCE_SA_KEY }} | |
GCE_REGION: ${{ secrets.GCE_REGION }} | |
MODEL_STORAGE_BUCKET: ${{ secrets.MODEL_STORAGE_BUCKET }} | |
jobs: | |
# ----------------------------------------------------------------------------------- # | |
# ----------------------------------------------------------------------------------- # | |
# ----------------------------------------------------------------------------------- # | |
# BUILD/PUSH BLUEBERT-BASE CONTAINER IMAGE # | |
# ----------------------------------------------------------------------------------- # | |
# ----------------------------------------------------------------------------------- # | |
# ----------------------------------------------------------------------------------- # | |
# # Note: when trying to run build_push-bert-base with other jobs below, an error is reported on line 90. | |
# # However, when run on its own it works fine. | |
# build_push-bert-base: | |
# name: "build/push bluebert-base container image" | |
# runs-on: ubuntu-latest | |
# env: | |
# IMAGE_NAME: bluebert-base | |
# DOCKERFILE: base.Dockerfile | |
# permissions: | |
# contents: 'read' | |
# id-token: 'write' | |
# steps: | |
# - uses: actions/checkout@v4 | |
# with: | |
# fetch-depth: 0 | |
# - id: 'auth' | |
# uses: 'google-github-actions/auth@v2' | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account: ${{ secrets.SERVICE_ACCOUNT }} | |
# credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }} | |
# - name: 'Set up Cloud SDK' | |
# uses: 'google-github-actions/setup-gcloud@v2' | |
# with: | |
# version: '>= 363.0.0' | |
# - name: Setup Python | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: 3.7 | |
# - name: Configure Docker Authentication | |
# run: gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# run: echo "MODEL_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# run: docker build --tag "gcr.io/$PROJECT_ID/$IMAGE_NAME:$MODEL_VERSION" -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# run: docker push "gcr.io/$PROJECT_ID/$IMAGE_NAME:$MODEL_VERSION" | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # TRAIN BL_GENE_LOSS_GAIN_OF_FUNCTION_TO_DISEASE MODEL # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push_train-bl_gene_loss_gain_of_function_to_disease-train: | |
# name: "build/push/train bl_gene_loss_gain_of_function_to_disease model" | |
# # needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_gene_loss_gain_of_function_to_disease | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/bl_gene_loss_gain_of_function_to_disease/data.tsv | |
# MODEL_VERSION_KEY: BL_GENE_LOSS_GAIN_OF_FUNCTION_TO_DISEASE | |
# AI_PLATFORM_JOB_NAME: "bl_gene_loss_gain_of_function_to_disease_train_${{ github.run_number }}" | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} model." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 1800 | |
# # -------------------------------------------------------------------------------------- # | |
# # BUILD/PUSH BL_GENE_LOSS_GAIN_OF_FUNCTION_TO_DISEASE CLASSIFICATION CONTAINER IMAGE # | |
# # -------------------------------------------------------------------------------------- # | |
# build_push-bl_gene_loss_gain_of_function_to_disease-predict: | |
# name: "build/push bl_gene_loss_gain_of_function_to_disease predict container" | |
# needs: "build_push_train-bl_gene_loss_gain_of_function_to_disease-train" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_gene_loss_gain_of_function_to_disease | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: BL_GENE_LOSS_GAIN_OF_FUNCTION_TO_DISEASE | |
# CLASSIFICATION_LABELS: "contributes_to_via_loss_of_function contributes_to_via_gain_of_function false" | |
# DATA_FILE: data/bl_gene_loss_gain_of_function_to_disease/data.tsv | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} predict container." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # TRAIN BL_CHEMICAL_TO_DISEASE_OR_PHENOTYPIC_FEATURE MODEL # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push_train-bl_chemical_to_disease_or_phenotypic_feature-train: | |
# name: "build/push/train bl_chemical_to_disease_or_phenotypic_feature model" | |
# needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_chemical_to_disease_or_phenotypic_feature | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/bl_chemical_to_disease_or_phenotypic_feature/data.tsv | |
# MODEL_VERSION_KEY: BL_CHEMICAL_TO_DISEASE_OR_PHENOTYPIC_FEATURE | |
# AI_PLATFORM_JOB_NAME: "bl_chemical_to_disease_or_phenotypic_feature_train_${{ github.run_number }}" | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} model." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 180 | |
# # -------------------------------------------------------------------------------------- # | |
# # BUILD/PUSH BL_CHEMICAL_TO_DISEASE_OR_PHENOTYPIC_FEATURE CLASSIFICATION CONTAINER IMAGE # | |
# # -------------------------------------------------------------------------------------- # | |
# build_push-bl_chemical_to_disease_or_phenotypic_feature-predict: | |
# name: "build/push bl_chemical_to_disease_or_phenotypic_feature predict container" | |
# needs: "build_push_train-bl_chemical_to_disease_or_phenotypic_feature-train" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_chemical_to_disease_or_phenotypic_feature | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: BL_CHEMICAL_TO_DISEASE_OR_PHENOTYPIC_FEATURE | |
# CLASSIFICATION_LABELS: "treats false" | |
# DATA_FILE: data/bl_chemical_to_disease_or_phenotypic_feature/data.tsv | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} predict container." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # TRAIN BL_CHEMICAL_TO_GENE MODEL # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push_train-bl_chemical_to_gene-train: | |
# name: "build/push/train bl_chemical_to_gene model" | |
# needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_chemical_to_gene | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/bl_chemical_to_gene/data.tsv | |
# MODEL_VERSION_KEY: BL_CHEMICAL_TO_GENE | |
# AI_PLATFORM_JOB_NAME: "bl_chemical_to_gene_train_${{ github.run_number }}" | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} model." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build ChemProt Corpus container image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --tag chemprot -f data/bl_chemical_to_gene/chemprot.Dockerfile data/bl_chemical_to_gene | |
# - name: Process ChemProt Corpus and append to data/bl_chemical_to_gene/data.tsv | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker run --rm -v "$PWD/data/bl_chemical_to_gene:/home/dev/output" chemprot | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 17280 | |
# # Initial training of the chemical_to_gene model required 250 minutes | |
# # using the basic_gpu tier (Tesla K80), so we set the timeout to 360 minutes | |
# # here to be sure to allow enough time to finish. Note: 360 minutes might be the | |
# # default timeout, so setting a timeout might not be necessary. | |
# # ----------------------------------------------------------------------------------- # | |
# # BUILD/PUSH BL_CHEMICAL_TO_GENE CLASSIFICATION CONTAINER IMAGE # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push-bl_chemical_to_gene-predict: | |
# name: "build/push bl_chemical_to_gene predict container" | |
# needs: "build_push_train-bl_chemical_to_gene-train" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_chemical_to_gene | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: BL_CHEMICAL_TO_GENE | |
# CLASSIFICATION_LABELS: "positively_regulates negatively_regulates false" | |
# DATA_FILE: data/bl_chemical_to_gene/data.tsv | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} predict container." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # TRAIN BL_DISEASE_TO_PHENOTYPIC_FEATURE MODEL # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push_train-bl_disease_to_phenotypic_feature-train: | |
# name: "build/push/train bl_disease_to_phenotypic_feature model" | |
# needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_disease_to_phenotypic_feature | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/bl_disease_to_phenotypic_feature/data.tsv | |
# MODEL_VERSION_KEY: BL_DISEASE_TO_PHENOTYPIC_FEATURE | |
# AI_PLATFORM_JOB_NAME: "bl_disease_to_phenotypic_feature_train_${{ github.run_number }}" | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} model." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 180 | |
# # ----------------------------------------------------------------------------------- # | |
# # BUILD/PUSH BL_DISEASE_TO_PHENOTYPIC_FEATURE CLASSIFICATION CONTAINER IMAGE # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push-bl_disease_to_phenotypic_feature-predict: | |
# name: "build/push bl_disease_to_phenotypic_feature predict container" | |
# needs: "build_push_train-bl_disease_to_phenotypic_feature-train" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_disease_to_phenotypic_feature | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: BL_DISEASE_TO_PHENOTYPIC_FEATURE | |
# CLASSIFICATION_LABELS: "has_symptom false" | |
# DATA_FILE: data/bl_disease_to_phenotypic_feature/data.tsv | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} predict container." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # TRAIN BL_GENE_REGULATORY_RELATIONSHIP MODEL # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push_train-bl_gene_regulatory_relationship-train: | |
# name: "build/push/train bl_gene_regulatory_relationship model" | |
# needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_gene_regulatory_relationship | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/bl_gene_regulatory_relationship/data.tsv | |
# MODEL_VERSION_KEY: BL_GENE_REGULATORY_RELATIONSHIP | |
# AI_PLATFORM_JOB_NAME: "bl_gene_regulatory_relationship_train_${{ github.run_number }}" | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} model." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build GeneReg Corpus container image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --tag genereg -f data/bl_gene_regulatory_relationship/genereg.Dockerfile data/bl_gene_regulatory_relationship | |
# - name: Process GeneReg Corpus and append to data/bl_gene_regulator_relationship/data.tsv | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker run --rm -v "$PWD/data/bl_gene_regulatory_relationship:/home/dev/output" genereg | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 180 | |
# # ----------------------------------------------------------------------------------- # | |
# # BUILD/PUSH BL_GENE_REGULATORY_RELATIONSHIP CLASSIFICATION CONTAINER IMAGE # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push-bl_gene_regulatory_relationship-predict: | |
# name: "build/push bl_gene_regulatory_relationship predict container" | |
# needs: "build_push_train-bl_gene_regulatory_relationship-train" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_gene_regulatory_relationship | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: BL_GENE_REGULATORY_RELATIONSHIP | |
# CLASSIFICATION_LABELS: "positively_regulates negatively_regulates false" | |
# DATA_FILE: data/bl_gene_regulatory_relationship/data.tsv | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} predict container." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # TRAIN BL_GENE_TO_DISEASE MODEL # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push_train-bl_gene_to_disease-train: | |
# name: "build/push/train bl_gene_to_disease model" | |
# # needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_gene_to_disease | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/bl_gene_to_disease/data.tsv | |
# MODEL_VERSION_KEY: BL_GENE_TO_DISEASE | |
# AI_PLATFORM_JOB_NAME: "bl_gene_to_disease_train_${{ github.run_number }}" | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} model." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 1800 | |
# # ----------------------------------------------------------------------------------- # | |
# # BUILD/PUSH BL_GENE_TO_DISEASE CLASSIFICATION CONTAINER IMAGE # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push-bl_gene_to_disease-predict: | |
# name: "build/push bl_gene_to_disease predict container" | |
# needs: "build_push_train-bl_gene_to_disease-train" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_gene_to_disease | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: BL_GENE_TO_DISEASE | |
# CLASSIFICATION_LABELS: "contributes_to false" | |
# DATA_FILE: data/bl_gene_to_disease/data.tsv | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} predict container." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # TRAIN BL_GENE_TO_EXPRESSION_SITE MODEL # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push_train-bl_gene_to_expression_site-train: | |
# name: "build/push/train bl_gene_to_expression_site model" | |
# needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_gene_to_expression_site | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/bl_gene_to_expression_site/data.tsv | |
# MODEL_VERSION_KEY: BL_GENE_TO_EXPRESSION_SITE | |
# AI_PLATFORM_JOB_NAME: "bl_gene_to_expression_site_train_${{ github.run_number }}" | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} model." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 180 | |
# # ----------------------------------------------------------------------------------- # | |
# # BUILD/PUSH BL_GENE_TO_EXPRESSION_SITE CLASSIFICATION CONTAINER IMAGE # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push-bl_gene_to_expression_site-predict: | |
# name: "build/push bl_gene_to_expression_site predict container" | |
# needs: "build_push_train-bl_gene_to_expression_site-train" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: bl_gene_to_expression_site | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: BL_GENE_TO_EXPRESSION_SITE | |
# CLASSIFICATION_LABELS: "expressed_in false" | |
# DATA_FILE: data/bl_gene_to_expression_site/data.tsv | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Get changed files | |
# id: changed-files | |
# uses: tj-actions/changed-files@v7 | |
# - name: List all modified files | |
# run: | | |
# for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# echo "$file was modified" | |
# done | |
# - name: Run step when a file changes | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} predict container." | |
# - name: Set up Cloud SDK | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# if: | | |
# contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # TRAIN CRAFT_RELATIONS MODEL # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push_train-craft_relations-train: | |
# name: "build/push/train craft_relations model" | |
# # needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: craft_relations | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/craft_relations/data.tsv | |
# MODEL_VERSION_KEY: CRAFT_RELATIONS | |
# AI_PLATFORM_JOB_NAME: "craft_relations_train_${{ github.run_number }}" | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# # - name: Get changed files | |
# # id: changed-files | |
# # uses: tj-actions/changed-files@v7 | |
# # - name: List all modified files | |
# # run: | | |
# # for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# # echo "$file was modified" | |
# # done | |
# - name: Run step when a file changes | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} model." | |
# - name: Set up Cloud SDK | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 180 | |
# # ----------------------------------------------------------------------------------- # | |
# # BUILD/PUSH CRAFT_RELATIONS CLASSIFICATION CONTAINER IMAGE # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push-craft_relations-predict: | |
# name: "build/push craft_relations predict container" | |
# # needs: "build_push_train-craft_relations-train" | |
# runs-on: ubuntu-latest | |
# env: | |
# TASK_NAME: craft_relations | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: CRAFT_RELATIONS | |
# CLASSIFICATION_LABELS: "bears_constitution_of_or_situatedness_at_or_possession_by_or_derivation_from coexists_as realizes_or_attribute_or_bearer_of_occurrence_in_or_possession_by realizes_or_bears_or_is_attribute_of_derivation_or_situatedness_or_possession_from false" | |
# DATA_FILE: data/craft_relations/data.tsv | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# # - name: Get changed files | |
# # id: changed-files | |
# # uses: tj-actions/changed-files@v7 | |
# # - name: List all modified files | |
# # run: | | |
# # for file in "${{ steps.changed-files.outputs.all_modified_files }}"; do | |
# # echo "$file was modified" | |
# # done | |
# - name: Run step when a file changes | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "A modified file has triggered a rebuild of the ${{ env.TASK_NAME }} predict container." | |
# - name: Set up Cloud SDK | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# uses: google-github-actions/setup-gcloud@main | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account_key: ${{ secrets.GCE_SA_KEY }} | |
# version: '290.0.1' | |
# - name: Configure Docker Authentication | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# # if: | | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.TRAIN_ENTRYPOINT_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.BASE_DOCKERFILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.DATA_FILE) || | |
# # contains(steps.changed-files.outputs.all_modified_files, env.ENTRYPOINT_FILE) | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # TRAIN CRAFT_RELATIONS MODEL - INFLUENCES # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push_train-craft_influence-train: | |
# name: "build/push/train craft_influence model" | |
# # needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: "read" | |
# id-token: "write" | |
# env: | |
# TASK_NAME: craft_influence | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/craft_influence/data.tsv | |
# MODEL_VERSION_KEY: CRAFT_INFLUENCES | |
# AI_PLATFORM_JOB_NAME: "craft_influence_train_${{ github.run_number }}" | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v2 | |
# - name: Authenticate to Google Cloud | |
# uses: google-github-actions/auth@v0 | |
# with: | |
# workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER_LOCATION }} | |
# service_account: "${{ secrets.SERVICE_ACCOUNT }}@${{ secrets.GCE_PROJECT }}.iam.gserviceaccount.com" | |
# - name: Configure Docker Authentication | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 180 | |
# # ----------------------------------------------------------------------------------- # | |
# # BUILD/PUSH CRAFT_RELATIONS INFLUENCE CLASSIFICATION CONTAINER IMAGE # | |
# # ----------------------------------------------------------------------------------- # | |
# build_push-craft_influence-predict: | |
# name: "build/push craft_influence predict container" | |
# needs: "build_push_train-craft_influence-train" | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: "read" | |
# id-token: "write" | |
# env: | |
# TASK_NAME: craft_influence | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: CRAFT_INFLUENCES | |
# CLASSIFICATION_LABELS: "coexists_as occurrence_or_attribute_or_effect_brought_about_or_carried_out_by occurrence_or_attribute_or_bearer_of_influence_on has_effect_of_causal_activity has_attribute_of_being_agentive_or_causal_or_its_realization_with has_attribute_of_being_influenced_or_its_realization_with false" | |
# DATA_FILE: data/craft_influence/data.tsv | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v2 | |
# - name: Authenticate to Google Cloud | |
# uses: google-github-actions/auth@v0 | |
# with: | |
# workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER_LOCATION }} | |
# service_account: "${{ secrets.SERVICE_ACCOUNT }}@${{ secrets.GCE_PROJECT }}.iam.gserviceaccount.com" | |
# - name: Configure Docker Authentication | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # TRAIN CRAFT_RELATIONS MODEL - PR_UBERON # | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # ----------------------------------------------------------------------------------- # | |
# build_push_train-craft_pr_uberon-train: | |
# name: "build/push/train craft_pr_uberon model" | |
# # needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: "read" | |
# id-token: "write" | |
# env: | |
# TASK_NAME: craft_pr_uberon | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/craft_pr_uberon/data.tsv | |
# MODEL_VERSION_KEY: CRAFT_PR_UBERON | |
# AI_PLATFORM_JOB_NAME: "craft_pr_uberon_train_${{ github.run_number }}" | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v2 | |
# - name: Authenticate to Google Cloud | |
# uses: google-github-actions/auth@v0 | |
# with: | |
# workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER_LOCATION }} | |
# service_account: "${{ secrets.SERVICE_ACCOUNT }}@${{ secrets.GCE_PROJECT }}.iam.gserviceaccount.com" | |
# - name: Configure Docker Authentication | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier basic_gpu --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 180 | |
# # # ----------------------------------------------------------------------------------- # | |
# # # BUILD/PUSH CRAFT_RELATIONS INFLUENCE CLASSIFICATION CONTAINER IMAGE # | |
# # # ----------------------------------------------------------------------------------- # | |
# build_push-craft_pr_uberon-predict: | |
# name: "build/push craft_pr_uberon predict container" | |
# # needs: "build_push_train-craft_pr_uberon-train" | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: "read" | |
# id-token: "write" | |
# env: | |
# TASK_NAME: craft_pr_uberon | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: CRAFT_PR_UBERON | |
# CLASSIFICATION_LABELS: "label1 label2 false" | |
# DATA_FILE: data/craft_pr_uberon/data.tsv | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v2 | |
# - name: Authenticate to Google Cloud | |
# uses: google-github-actions/auth@v0 | |
# with: | |
# workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER_LOCATION }} | |
# service_account: "${{ secrets.SERVICE_ACCOUNT }}@${{ secrets.GCE_PROJECT }}.iam.gserviceaccount.com" | |
# - name: Configure Docker Authentication | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # TRAIN CRAFT_RELATIONS MODEL - PR_TAXON # | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # ----------------------------------------------------------------------------------- # | |
# build_push_train-craft_100-train: | |
# name: "build/push/train craft_100 model" | |
# # needs: "build_push-bert-base" | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: "read" | |
# id-token: "write" | |
# env: | |
# TASK_NAME: craft_100 | |
# DOCKERFILE: train.Dockerfile | |
# ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# DATA_FILE: data/craft_100/data.tsv | |
# MODEL_VERSION_KEY: CRAFT_100 | |
# AI_PLATFORM_JOB_NAME: "craft_100_train_${{ github.run_number }}" | |
# steps: | |
# - uses: actions/checkout@v4 | |
# with: | |
# fetch-depth: 0 | |
# - id: 'auth' | |
# uses: 'google-github-actions/auth@v2' | |
# with: | |
# project_id: ${{ secrets.GCE_PROJECT }} | |
# service_account: ${{ secrets.SERVICE_ACCOUNT }} | |
# credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }} | |
# - name: 'Set up Cloud SDK' | |
# uses: 'google-github-actions/setup-gcloud@v2' | |
# with: | |
# version: '>= 363.0.0' | |
# - name: Setup Python | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: 3.7 | |
# - name: Configure Docker Authentication | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set NUM_EPOCHS env | |
# run: | | |
# echo "NUM_EPOCHS=5.0" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "EPOCHS=$NUM_EPOCHS" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
# - name: Submit a training job to AI Plaform to train and cache the model | |
# run: | | |
# gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
# --scale-tier=CUSTOM \ | |
# --master-machine-type=n1-standard-8 \ | |
# --master-accelerator=count=1,type=nvidia-tesla-v100 \ | |
# --region "$GCE_REGION" \ | |
# --master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
# -- \ | |
# NO_ARG \ | |
# "gs://$MODEL_STORAGE_BUCKET" | |
# - name: Monitor the training job | |
# run: | | |
# sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
# timeout-minutes: 500 | |
# # # # ----------------------------------------------------------------------------------- # | |
# # # # BUILD/PUSH CRAFT_RELATIONS INFLUENCE CLASSIFICATION CONTAINER IMAGE # | |
# # # # ----------------------------------------------------------------------------------- # | |
# build_push-craft_100-predict: | |
# name: "build/push craft_100 predict container" | |
# needs: "build_push_train-craft_100-train" | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: "read" | |
# id-token: "write" | |
# env: | |
# TASK_NAME: craft_100 | |
# DOCKERFILE: predict.Dockerfile | |
# TRAIN_DOCKERFILE: train.Dockerfile | |
# TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
# ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
# BASE_DOCKERFILE: base.Dockerfile | |
# MODEL_VERSION_KEY: CRAFT_100 | |
# CLASSIFICATION_LABELS: "realization_or_attribute_or_bearer_of_situatedness_or_inherence_in is_or_bears_constitution_of_or_situation_at_or_coming_from_or_possession_by is_object_of_assertion_with_subject_instance_different_from_that_of has_attribute_of_being_agentive_or_causal_or_its_realization_with attribute_or_bearer_of_situatedness_or_possession_of_or_of_variant_of has_attribute_of_variant_absence_or_lack_of_functionality coexists_as bears_situatedness_or_possession_of occurrence_or_attribute_of_processing_or_bringing_about_of is_or_bears_derivational_relation_to_or_bears_information_of occurrence_or_attribute_or_effect_brought_about_or_carried_out_by has_attribute_of_variation_and_situatedness occurrence_or_attribute_or_bearer_of_involvement_of_or_with occurrence_or_attribute_or_bearer_of_involvement_of occurrence_or_attribute_or_bearer_of_change_of occurrence_or_attribute_or_bearer_of_bringing_about_of occurrence_or_attribute_or_bearer_of_coming_from realization_or_attribute_or_bearer_of_occurrence_or_involvement_in_or_with occurrence_or_attribute_or_bearer_of_realization_by occurrence_or_attribute_or_bearer_of_derivation_from region_of bearer_of_associativity_with has_variant_or_attribute_of_variation has_attribute_of_activity_or_its_realization_with coexists_as_subtype_in_nonexhaustive_partition has_attribute_of_being_processed_or_brought_about_or_its_realization_with has_occurrence_or_attribute_of_change realizes_or_attribute_or_bearer_of_location_or_position_of is_associated_with_or_situated_at_or_involves attribute_or_bearer_of_holding_within_of is_subject_of_assertion_with_object_instance_different_from_that_of has_attribute_of_being_average_or_common_or_normal_or_standard_or_typical has_attribute_of_decreased_or_lower_dimension_or_its_realization_with is_or_bears_constitution_of_or_situation_at_or_coming_from_or_possession_by_or_encoded_information_of has_attribute_of_being_brought_about_or_its_realization_with occurrence_or_attribute_or_bearer_of_influence_on occurrence_or_attribute_or_bearer_of_arrangement_of_or_in realization_or_attribute_or_bearer_of_situatedness_at has_occurrence_or_attribute_of_being_or_becoming_something_with_something_arranged_or_situated_in_or_through_or_among_it has_attribute_of_development_or_its_realization_with occurrence_or_attribute_or_effect_of_loss_of absence_of realization_or_attribute_or_bearer_of_temporal_occurrence_during has_occurrence_or_attribute_of_being_or_becoming_associated_with_something is_variant_sequence_bearing_derivational_relation_to_or_information_of deficiency_of has_occurrence_or_attribute_of_being_or_becoming_associatively_arranged_or_situated_to_or_with_something attribute_or_bearer_of_variant_absence_or_lack_of_functionality_of has_realizational_function_for_or_application_to_or_involvement_in occurrence_or_attribute_or_bearer_of_activity_of_or_as occurrence_or_attribute_or_bearer_of_aggregation_of occurrence_or_attribute_or_bearer_of_activation_of realization_or_attribute_or_bearer_of_temporal_occurrence_after occurrence_or_attribute_of_release_of has_attribute_of_progression_or_its_realization_with occurrence_or_attribute_of_specializing_development_of has_attribute_of_greater_dimension_or_its_realization_with occurrence_or_attribute_or_bearer_of_development_of has_occurrence_or_attribute_of_being_or_becoming_separate_or_separated false" | |
# DATA_FILE: data/craft_100/data.tsv | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v2 | |
# - name: Authenticate to Google Cloud | |
# uses: google-github-actions/auth@v0 | |
# with: | |
# workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER_LOCATION }} | |
# service_account: "${{ secrets.SERVICE_ACCOUNT }}@${{ secrets.GCE_PROJECT }}.iam.gserviceaccount.com" | |
# - name: Configure Docker Authentication | |
# run: | | |
# gcloud --quiet auth configure-docker | |
# - name: Set MODEL_VERSION env | |
# run: | | |
# echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Set BASE_VERSION env | |
# run: | | |
# echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
# - name: Build Docker Image | |
# run: | | |
# docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
# --build-arg "TASK_NAME=$TASK_NAME" \ | |
# --build-arg "BASE_VERSION=$BASE_VERSION" \ | |
# --build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
# --build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
# --build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
# --tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
# -f ${{ env.DOCKERFILE }} . | |
# - name: Publish Docker Image to Google Container Registry | |
# run: | | |
# docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" | |
# # # ----------------------------------------------------------------------------------- # | |
# # # ----------------------------------------------------------------------------------- # | |
# # # ----------------------------------------------------------------------------------- # | |
# # # TRAIN CRAFT_RELATIONS MODEL - 1 vs all # | |
# # # ----------------------------------------------------------------------------------- # | |
# # # ----------------------------------------------------------------------------------- # | |
# # # ----------------------------------------------------------------------------------- # | |
build_push_train-craft_1_vs_all-train: | |
name: "build/push/train craft_1_vs_all model" | |
# needs: "build_push-bert-base" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
env: | |
TASK_NAME: craft_1_vs_all | |
DOCKERFILE: train.Dockerfile | |
ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
BASE_DOCKERFILE: base.Dockerfile | |
DATA_FILE: data/craft_1_vs_all/data.tsv | |
MODEL_VERSION_KEY: CRAFT_1_VS_ALL | |
AI_PLATFORM_JOB_NAME: "craft_1_vs_all_train_${{ github.run_number }}" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
project_id: ${{ secrets.GCE_PROJECT }} | |
service_account: ${{ secrets.SERVICE_ACCOUNT }} | |
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }} | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v2' | |
with: | |
version: '>= 363.0.0' | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Configure Docker Authentication | |
run: | | |
gcloud --quiet auth configure-docker | |
- name: Set MODEL_VERSION env | |
run: | | |
echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
- name: Set BASE_VERSION env | |
run: | | |
echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
- name: Set NUM_EPOCHS env | |
run: | | |
echo "NUM_EPOCHS=5.0" >> $GITHUB_ENV | |
- name: Build Docker Image | |
run: | | |
docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
--build-arg "TASK_NAME=$TASK_NAME" \ | |
--build-arg "BASE_VERSION=$BASE_VERSION" \ | |
--build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
--build-arg "EPOCHS=$NUM_EPOCHS" \ | |
--tag "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
-f ${{ env.DOCKERFILE }} . | |
- name: Publish Docker Image to Google Container Registry | |
run: | | |
docker push "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" | |
- name: Submit a training job to AI Plaform to train and cache the model | |
run: | | |
gcloud ai-platform jobs submit training ${{ env.AI_PLATFORM_JOB_NAME }} \ | |
--scale-tier=CUSTOM \ | |
--master-machine-type=n1-standard-8 \ | |
--master-accelerator=count=1,type=nvidia-tesla-v100 \ | |
--region "$GCE_REGION" \ | |
--master-image-uri "gcr.io/$PROJECT_ID/$TASK_NAME-train:$MODEL_VERSION" \ | |
-- \ | |
NO_ARG \ | |
"gs://$MODEL_STORAGE_BUCKET" | |
- name: Monitor the training job | |
run: | | |
sh -c ".github/workflows/monitor-ai-platform-job.sh ${{ env.AI_PLATFORM_JOB_NAME }}" | |
timeout-minutes: 500 | |
# # # ----------------------------------------------------------------------------------- # | |
# # # BUILD/PUSH CRAFT_RELATIONS INFLUENCE CLASSIFICATION CONTAINER IMAGE # | |
# # # ----------------------------------------------------------------------------------- # | |
build_push-craft_1_vs_all-predict: | |
name: "build/push craft_1_vs_all predict container" | |
needs: "build_push_train-craft_1_vs_all-train" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
env: | |
TASK_NAME: craft_1_vs_all | |
DOCKERFILE: predict.Dockerfile | |
TRAIN_DOCKERFILE: train.Dockerfile | |
TRAIN_ENTRYPOINT_FILE: scripts/train.entrypoint.sh | |
ENTRYPOINT_FILE: scripts/predict.entrypoint.sh | |
BASE_DOCKERFILE: base.Dockerfile | |
MODEL_VERSION_KEY: CRAFT_1_VS_ALL | |
CLASSIFICATION_LABELS: "label1 false" | |
DATA_FILE: data/craft_1_vs_all/data.tsv | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v0 | |
with: | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER_LOCATION }} | |
service_account: "${{ secrets.SERVICE_ACCOUNT }}@${{ secrets.GCE_PROJECT }}.iam.gserviceaccount.com" | |
- name: Configure Docker Authentication | |
run: | | |
gcloud --quiet auth configure-docker | |
- name: Set MODEL_VERSION env | |
run: | | |
echo "MODEL_VERSION=$(grep ${{ env.MODEL_VERSION_KEY }} MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
- name: Set BASE_VERSION env | |
run: | | |
echo "BASE_VERSION=$(grep 'BASE' MODEL_VERSIONS | cut -f 2 -d '=')" >> $GITHUB_ENV | |
- name: Build Docker Image | |
run: | | |
docker build --build-arg "PROJECT_ID=$PROJECT_ID" \ | |
--build-arg "TASK_NAME=$TASK_NAME" \ | |
--build-arg "BASE_VERSION=$BASE_VERSION" \ | |
--build-arg "TUNED_MODEL_VERSION=$MODEL_VERSION" \ | |
--build-arg "MODEL_STORAGE_BUCKET=$MODEL_STORAGE_BUCKET" \ | |
--build-arg "CLASSIFICATION_LABELS=${{ env.CLASSIFICATION_LABELS }}" \ | |
--tag "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" \ | |
-f ${{ env.DOCKERFILE }} . | |
- name: Publish Docker Image to Google Container Registry | |
run: | | |
docker push "gcr.io/$PROJECT_ID/$TASK_NAME-predict:$MODEL_VERSION" |