-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
111 lines (91 loc) · 3.4 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Copyright (c) 2023 Ho Kim (ho.kim@ulagbulag.io). 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 ALPINE_VERSION := env_var_or_default('ALPINE_VERSION', '3.18')
export DESKTOP_DIST := env_var_or_default('DESKTOP_DIST', 'ubuntu')
export DESKTOP_VERSION := env_var_or_default('DESKTOP_VERSION', 'latest')
export OCI_BUILD_LOG_DIR := env_var_or_default('OCI_BUILD_LOG_DIR', './logs/')
export OCI_IMAGE := env_var_or_default('OCI_IMAGE', 'quay.io/ulagbulag/openark')
export OCI_IMAGE_VERSION := env_var_or_default('OCI_IMAGE_VERSION', 'latest')
export OCI_PLATFORMS := env_var_or_default('OCI_PLATFORMS', 'linux/arm64,linux/amd64')
export AWS_REGION := env_var_or_default('AWS_REGION', 'us-east-1')
export AWS_SECURE_TLS := if env_var_or_default("AWS_ENDPOINT_URL", '') =~ 'http://' { 'false' } else { 'true' }
export DEFAULT_CONTAINER_RUNTIME := env_var_or_default('CONTAINER_RUNTIME', 'docker buildx')
export DEFAULT_RUNTIME_PACKAGE := env_var_or_default('RUNTIME_PACKAGE', 'ark-cli')
export PIPE_MODEL := env_var_or_default('PIPE_MODEL', 'buildkit')
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 }}
oci-build *ARGS:
mkdir -p "${OCI_BUILD_LOG_DIR}"
${DEFAULT_CONTAINER_RUNTIME} build \
--file './Dockerfile' \
--tag "${OCI_IMAGE}:${OCI_IMAGE_VERSION}" \
--build-arg ALPINE_VERSION="${ALPINE_VERSION}" \
--platform "${OCI_PLATFORMS}" \
--pull \
{{ ARGS }} \
. 2>&1 | tee "${OCI_BUILD_LOG_DIR}/build-base-$( date -u +%s ).log"
oci-build-devel *ARGS:
${DEFAULT_CONTAINER_RUNTIME} build \
--file './Dockerfile.devel' \
--tag "${OCI_IMAGE}:${OCI_IMAGE_VERSION}-devel" \
--build-arg ALPINE_VERSION="${ALPINE_VERSION}" \
--build-arg DESKTOP_DIST="${DESKTOP_DIST}" \
--build-arg DESKTOP_VERSION="${DESKTOP_VERSION}" \
--platform "linux/amd64" \
--pull \
{{ ARGS }} \
. 2>&1 | tee "${OCI_BUILD_LOG_DIR}/build-devel-$( date -u +%s ).log"
oci-build-full *ARGS:
${DEFAULT_CONTAINER_RUNTIME} build \
--file './Dockerfile.full' \
--tag "${OCI_IMAGE}:${OCI_IMAGE_VERSION}-full" \
--build-arg ALPINE_VERSION="${ALPINE_VERSION}" \
--platform "${OCI_PLATFORMS}" \
--pull \
{{ ARGS }} \
. 2>&1 | tee "${OCI_BUILD_LOG_DIR}/build-full-$( date -u +%s ).log"
oci-push: (oci-build "--push")
oci-push-devel: (oci-build-devel "--push")
oci-push-full: (oci-build-full "--push")
oci-push-and-update-dash: oci-push
kubectl -n dash rollout restart deploy \
gateway \
operator
oci-push-and-update-kiss: oci-push
# kubectl -n kiss rollout restart deploy assets
kubectl -n kiss rollout restart deploy \
dns \
gateway \
monitor \
operator
oci-push-and-update-kubegraph: oci-push
kubectl -n kubegraph rollout restart deploy \
gateway \
kubegraph \
market-gateway \
market-solver \
operator
oci-push-and-update-vine: oci-push
kubectl -n vine rollout restart deploy \
bastion \
operator