-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
55 lines (44 loc) · 1.35 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
set dotenv-load := true
# List recipes
list:
@just --list --unsorted
# Prepare with given pbp package version and host workspace location
prepare version host_workspace:
@echo "export PBP_VERSION={{version}}" > .env
@echo "export PBP_IMAGE=mbari/pbp-jupyter:{{version}}" >> .env
@echo "export HOST_WORKSPACE={{host_workspace}}" >> .env
@cat .env
# Create docker image
dockerize:
#!/usr/bin/env bash
set -eu
cat .env
cd root
docker build \
-f ../Dockerfile \
-t $PBP_IMAGE \
--build-arg PBP_VERSION=$PBP_VERSION \
--build-arg USER_UID=$(id -u) \
.
# Run image via compose
up *args="-d":
docker compose up {{args}}
# Shutdown launched image via compose
down *args="":
docker compose down {{args}}
# Tail pbp-jupyter container logs
logs tail="100":
docker logs --tail={{tail}} -f pbp-jupyter
## Though the main purpose is running jupyter, one can also run the CLI programs directly:
## NOTE: volume mapping(s) would be needed to access local filesystem.
# Run pbp-json-gen
pbp-json-gen *args="":
just _run-cli pbp-json-gen {{args}}
# Run pbp
pbp *args="":
just _run-cli pbp {{args}}
# Run pbp-plot
pbp-plot *args="":
just _run-cli pbp-plot {{args}}
_run-cli cli *args="":
docker run -it --rm --name {{cli}} $PBP_IMAGE {{cli}} {{args}}