Skip to content

Commit

Permalink
chore: add docker compose yaml (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
grieve54706 authored Dec 6, 2024
1 parent 6c8557a commit 9399b5d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
13 changes: 13 additions & 0 deletions docker/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
ibis-server:
image: ghcr.io/canner/wren-engine-ibis:latest
ports:
- "8000:8000"
environment:
WREN_ENGINE_ENDPOINT: http://java-engine:8080
java-engine:
image: ghcr.io/canner/wren-engine:latest
ports:
- "8080:8080"
volumes:
- ./etc:/usr/src/app/etc
1 change: 1 addition & 0 deletions docker/etc/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node.environment=test
36 changes: 21 additions & 15 deletions ibis-server/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,62 @@ default:
@just --list --unsorted

build-core *args:
cd ../wren-core-py && just install && just build {{args}}
cd ../wren-core-py && just install && just build {{ args }}

core-wheel-path := "../wren-core-py/target/wheels/wren_core_py-*.whl"

install-core *args:
just build-core {{args}}
just build-core {{ args }}
# Using pip install to avoid adding wheel to pyproject.toml
poetry run pip install {{core-wheel-path}}
poetry run pip install {{ core-wheel-path }}

update-core: build-core
poetry run pip install --force-reinstall {{core-wheel-path}}
poetry run pip install --force-reinstall {{ core-wheel-path }}

install *args:
poetry install {{args}}
poetry install {{ args }}

pre-commit-install:
poetry run pre-commit install

port := "8000"

run:
poetry run fastapi run --port {{port}}
poetry run fastapi run --port {{ port }}

dev:
poetry run fastapi dev --port {{port}}
poetry run fastapi dev --port {{ port }}

# run the pytest tests for the given marker
test MARKER:
poetry run pytest -m '{{ MARKER }}'

image-name := "ghcr.io/canner/wren-engine-ibis:latest"

docker-build:
# alias for `docker-build`
dbuild:
docker buildx build -t wren-engine-ibis -f Dockerfile \
docker buildx build -t {{ image-name }} -f Dockerfile \
--build-context wren-core-py=../wren-core-py \
--build-context wren-core=../wren-core \
.

docker-run:
# alias for `docker-run`
drun:
docker run -it --rm -p 8000:8000 --env-file .env wren-engine-ibis
docker run -it --rm -p 8000:8000 --env-file .env {{ image-name }}

compose-up:
docker compose -f ../docker/compose.yaml up

compose-down:
docker compose -f ../docker/compose.yaml down

lint:
poetry run ruff format -q . --check
poetry run ruff check .

format:
# alias for `format`
fmt:
poetry run ruff format .
poetry run ruff check --fix .
taplo fmt

alias dbuild := docker-build
alias drun := docker-run
alias fmt := format

0 comments on commit 9399b5d

Please sign in to comment.