-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from wandb/fix-wandb-job-create
fix(launch): make repo compatible with git sourced jobs
- Loading branch information
Showing
17 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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. |