-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJustfile
76 lines (59 loc) · 2.34 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright (c) 2024 Ho Kim ([email protected]). All rights reserved.
# Use of this source code is governed by a GPL-3-style license that can be
# found in the LICENSE file.
# Load environment variables
set dotenv-load
# Configure environment variables
export OCI_BUILD_LOG_DIR := env_var_or_default('OCI_BUILD_LOG_DIR', './logs/')
export OCI_IMAGE_BASE := env_var_or_default('OCI_IMAGE_BASE', 'quay.io/ulagbulag')
export OCI_IMAGE_VERSION := env_var_or_default('OCI_IMAGE_VERSION', 'latest')
export OCI_PLATFORMS := env_var_or_default('OCI_PLATFORMS', 'linux/amd64')
export DEFAULT_CONTAINER_RUNTIME := env_var_or_default('CONTAINER_RUNTIME', 'docker buildx')
export DEFAULT_RUNTIME_PACKAGE := env_var_or_default('RUNTIME_PACKAGE', 'cdl')
default:
@just run
init-conda:
conda install --yes \
-c pytorch -c nvidia \
autopep8 pip python \
pytorch torchvision torchaudio pytorch-cuda=11.8
pip install -r ./requirements.txt
fmt:
cargo fmt --all
build: fmt
cargo build --all --workspace
clippy: fmt
cargo clippy --all --workspace
test: clippy
cargo test --all --workspace
run *ARGS:
cargo run --package "${DEFAULT_RUNTIME_PACKAGE}" --release -- {{ ARGS }}
run-operator *ARGS:
cargo run --package "cdl-k8s-operator" --release -- {{ ARGS }}
oci-build *ARGS:
mkdir -p "${OCI_BUILD_LOG_DIR}/cdl"
${DEFAULT_CONTAINER_RUNTIME} build \
--file './Dockerfile' \
--tag "${OCI_IMAGE_BASE}/connected-data-lake:${OCI_IMAGE_VERSION}" \
--build-arg PACKAGE="cdl" \
--platform "${OCI_PLATFORMS}" \
--pull \
{{ ARGS }} \
. 2>&1 | tee "${OCI_BUILD_LOG_DIR}/cdl/build-$( date -u +%s ).log"
oci-build-operator *ARGS:
mkdir -p "${OCI_BUILD_LOG_DIR}/cdl-k8s-operator"
${DEFAULT_CONTAINER_RUNTIME} build \
--file './Dockerfile' \
--tag "${OCI_IMAGE_BASE}/connected-data-lake-operator:${OCI_IMAGE_VERSION}" \
--build-arg PACKAGE="cdl-k8s-operator" \
--platform "${OCI_PLATFORMS}" \
--pull \
{{ ARGS }} \
. 2>&1 | tee "${OCI_BUILD_LOG_DIR}/cdl-k8s-operator/build-$( date -u +%s ).log"
oci-push: (oci-build "--push")
oci-push-operator: (oci-build-operator "--push")
oci-push-and-update-operator: oci-push-operator
@just helm-clean-install
helm-clean-install:
helm uninstall -n "cdl-operator" "cdl-operator" || true
helm install --create-namespace -n "cdl-operator" "cdl-operator" "./charts/cdl-operator"