Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .devcontainer/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions .devcontainer/devcontainer.json

This file was deleted.

15 changes: 0 additions & 15 deletions .dockerignore

This file was deleted.

1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ updates:

- package-ecosystem: "docker"
directories:
- "/docker"
- "/docker/images/*"
schedule:
interval: "monthly"
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,17 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync
run: uv sync
- name: Install just
run: sudo apt-get update && sudo apt-get install -y just
- name: Run lint check
if: ${{ matrix.python-version == '3.11' }}
run: |
uv run bin/lint.sh
run: just lint
- name: Run tests
env:
SENTRY_DSN: http://public@localhost:8090/1
STORAGE_EMULATOR_HOST: http://localhost:8001
PUBSUB_EMULATOR_HOST: localhost:5010
run: |
docker compose up -d fakesentry gcs-emulator pubsub
# Run outside docker because we are testing the matrix python version
uv run bin/test.sh
just test
# stop services immediate and ignore errors
docker compose down -t0 || true
just down -t0 || true

build-and-release:
permissions:
Expand All @@ -59,8 +53,7 @@ jobs:
with:
python-version: 3.11
- name: Install dependencies
run: |
uv sync
run: uv sync
- name: Generate release tag
run: echo RELEASE_TAG="$(uv run python -c 'import obs_common.release; print(obs_common.release.generate_tag())')" >> "$GITHUB_ENV"
- name: Overrride wheel version
Expand All @@ -78,7 +71,7 @@ jobs:
run: uv build --wheel
- name: Build docker images for publishing
run: |
docker compose build fakesentry gcs-emulator
just build fakesentry gcs-emulator
GAR_REPO="us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/cavendish-prod"
FAKESENTRY_TAG="$GAR_REPO/fakesentry:${{ env.RELEASE_TAG }}"
docker tag local/obs-common-fakesentry:latest "$FAKESENTRY_TAG"
Expand Down
9 changes: 9 additions & 0 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@

set -euo pipefail

# Set Pub/Sub library to use emulator
export PUBSUB_EMULATOR_HOST="localhost:${EXPOSE_PUBSUB_EMULATOR_PORT:-5010}"

# Set GCS library to use emulator
export STORAGE_EMULATOR_HOST="http://localhost:${EXPOSE_GCS_EMULATOR_PORT:-8001}"

# Set up fakesentry
export SENTRY_DSN="http://public@localhost:${EXPOSE_SENTRY_PORT:-8090}/1"

# Wait for services to be ready (both have the same endpoint url)
echo ">>> wait for services"
waitfor --verbose "http://${PUBSUB_EMULATOR_HOST}"
Expand Down
36 changes: 0 additions & 36 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
services:
shell:
build:
context: .
dockerfile: docker/Dockerfile
args:
userid: ${USE_UID:-10001}
groupid: ${USE_GID:-10001}
image: local/obs-common-shell
env_file:
- docker/config/local_dev.env
links:
- fakesentry
- gcs-emulator
- pubsub
volumes:
- .:/app
- /app/.venv

devcontainer:
build:
dockerfile: .devcontainer/Dockerfile
args:
userid: ${USE_UID:-10001}
groupid: ${USE_GID:-10001}
image: local/obs-common-devcontainer
entrypoint: ["sleep", "inf"]
env_file:
- docker/config/local_dev.env
links:
- fakesentry
- gcs-emulator
- pubsub
volumes:
- .:/app
- /app/.venv

# https://github.com/willkg/kent
fakesentry:
build:
Expand Down
33 changes: 0 additions & 33 deletions docker/Dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions docker/config/local_dev.env

This file was deleted.

22 changes: 9 additions & 13 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,18 @@ _default:
build *args:
docker compose --progress plain build {{args}}

# Open a shell in docker.
shell *args:
docker compose run --rm shell {{args}}
# Start Docker containers.
up *args='--detach':
docker compose up {{args}}

# Run VS Code development container.
devcontainer:
docker compose up --detach devcontainer

# Run uv inside the container
uv *args:
docker compose run --rm --no-deps shell uv {{args}}
# Stop and remove Docker containers.
down *args:
docker compose down {{args}}

# Lint code, or use --fix to reformat and apply auto-fixes for lint.
lint *args:
docker compose run --rm --no-deps shell bin/lint.sh {{args}}
uv run bin/lint.sh {{args}}

# Run tests.
test *args:
docker compose run --rm shell bin/test.sh {{args}}
test *args: up
uv run bin/test.sh {{args}}
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ dependencies = [

[dependency-groups]
dev = [
"ipython",
"pytest",
"requests",
"ruff"
"ruff",
]

[project.scripts]
Expand Down