Skip to content

Commit

Permalink
Merge pull request #37 from wandb/fix-wandb-job-create
Browse files Browse the repository at this point in the history
fix(launch): make repo compatible with git sourced jobs
  • Loading branch information
bcsherma authored Jan 19, 2024
2 parents fa8fe74 + f7d6f3c commit c1497c7
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 15 deletions.
56 changes: 41 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,52 @@
version: 2.1

jobs:
build:
resource_class: medium
build_and_push_image:
parameters:
subdir:
type: string
docker:
- image: cimg/base:2023.03
- image: cimg/python:3.7
steps:
- setup_remote_docker:
docker_layer_caching: false
- checkout
- setup_remote_docker
- run:
name: Build Docker image
name: Check for Changes in Subdirectory
command: |
docker buildx create --platform linux/amd64,linux/arm64 --use
echo $DOCKERHUB_TOKEN | docker login --username davidwandb --password-stdin
./docker_build.py
if git diff --name-only HEAD~1...HEAD | grep '<< parameters.subdir >>'; then
echo "Changes detected in << parameters.subdir >>, building Docker image."
echo $DOCKERHUB_TOKEN | docker login --username davidwandb --password-stdin
docker buildx create --platform linux/amd64,linux/arm64 --use
cd << parameters.subdir >>
image_name=$(echo "<< parameters.subdir >>" | sed 's/jobs\//job_/g; s/\//_/g')
docker buildx build --platform linux/amd64,linux/arm64 -t wandb/$image_name:$CIRCLE_BRANCH --push --file Dockerfile.wandb .
else
echo "No changes in << parameters.subdir >>, skipping build."
fi
workflows:
build:
build_and_deploy:
jobs:
- hold:
type: approval
- build:
requires:
- hold
- build_and_push_image:
filters:
branches:
only: main
matrix:
parameters:
subdir:
[
"jobs/deploy_to_nvidia_triton",
"jobs/deploy_to_sagemaker_endpoints",
"jobs/distributed_test",
"jobs/fashion_mnist_train",
"jobs/github_actions_workflow_dispatch",
"jobs/gpu_optimize_with_tensor_rt",
"jobs/hello_world",
"jobs/http_webhook",
"jobs/msft_teams_webhook",
"jobs/openai_evals",
"jobs/sql_query",
"jobs/stable_diffusion_inference",
"jobs/sweep_schedulers/optuna_scheduler",
"jobs/sweep_schedulers/wandb_scheduler",
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This is temporarily required to make this repo compatible
# with the `wandb job create git` command, which until wandb==0.16.3
# required a requirements.txt to exist in the root of the repository.

0 comments on commit c1497c7

Please sign in to comment.