Skip to content

Commit

Permalink
Fix separators in catalog and dev-env images and dev-env volume (#4526)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkb authored Jun 26, 2024
1 parent 27184c1 commit 575db5f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,33 @@ jobs:
uses: ./.github/actions/load-img
with:
run_id: ${{ github.run_id }}
setup_images: upstream_db catalog
setup_images: upstream_db

# Sets build args specifying versions needed to build Docker image.
- name: Prepare build args
id: prepare-build-args
run: |
just versions | tee "$GITHUB_OUTPUT"
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Build catalog dev image
uses: docker/build-push-action@v5
with:
context: catalog
target: cat
push: false
load: true
tags: openverse-catalog
cache-from: type=gha,scope=catalog_dev
cache-to: type=gha,scope=catalog_dev
build-args: |
CATALOG_PY_VERSION=${{ steps.prepare-build-args.outputs.catalog_py_version }}
CATALOG_AIRFLOW_VERSION=${{ steps.prepare-build-args.outputs.catalog_airflow_version }}
REQUIREMENTS_FILE=requirements-dev.txt
- name: Run tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion catalog/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ x-airflow-common: &airflow-common
depends_on:
- postgres
- s3
image: openverse_catalog
image: openverse-catalog
env_file:
- .env
build:
Expand Down
8 changes: 4 additions & 4 deletions docker/dev_env/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

set -e

container_name="openverse-dev-env"
volume_name="$container_name"
container_name="openverse-dev_env"
volume_name="openverse_dev-env"

if ! docker volume inspect openverse-dev-env &>/dev/null; then
if ! docker volume inspect openverse-dev_env &>/dev/null; then
docker volume create "$volume_name" 1>/dev/null
fi

Expand Down Expand Up @@ -97,7 +97,7 @@ fi
existing_container_id=$(docker ps -a --filter name="$container_name" -q)

if [ -z "$existing_container_id" ]; then
docker run "${shared_args[@]}" "${run_args[@]}" openverse-dev-env:latest
docker run "${shared_args[@]}" "${run_args[@]}" openverse-dev_env:latest
else
# Do not need to bother checking if the container is already running, docker start
# is a noop in that case with no adverse effects
Expand Down
12 changes: 6 additions & 6 deletions ov
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,24 @@ init)
;;

build)
docker build "${@:2}" -t openverse-dev-env:latest "$dev_env"
docker build "${@:2}" -t openverse-dev_env:latest "$dev_env"
;;

setup-env)
"$_self" bash "$dev_env"/setup_env.sh
;;

stop)
docker stop openverse-dev-env
docker stop openverse-dev_env
;;

clean)
# Using `|| true` allows these commands to be skipped if the
# container, image or volume does not exist.
docker container stop openverse-dev-env || true
docker container rm openverse-dev-env || true
docker image rm openverse-dev-env || true
docker volume rm openverse-dev-env || true
docker container stop openverse-dev_env || true
docker container rm openverse-dev_env || true
docker image rm openverse-dev_env || true
docker volume rm openverse_dev-env || true
;;

hook)
Expand Down

0 comments on commit 575db5f

Please sign in to comment.