-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathJustfile
98 lines (76 loc) · 2.52 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
set dotenv-load := true
dat_version := "0.0.3"
dat_dir := "dat"
local_config := "config/local.yaml"
# Show available commands
default:
@just --list --justfile {{ justfile() }}
# Conduct a rust checking
check:
@cargo check
# Clean up the pre-build target
clean:
@cargo clean
# Conduct a full release build
build:
@# This causes cargo to have to rebuild the binary,
@# even if no Rust code has changed either.
@cargo build --release
# Conduct unit tests
test:
@cargo test --lib -- --nocapture
# Conduct DB-related unit tests
test-integration:
@# Be sure run the following command before conducting this:
@# $ docker compose -f ./devops/local/docker-compose.yaml up
@cargo test --tests -- --nocapture
alias testdb := test-integration
# Run local docker emvironment
docker:
docker-compose -f docker/compose.yaml up -d
# Run server locally
server:
@RUST_BACKTRACE=1 cargo run -- server
# Build delta-sharing-rs into a docker image for local use
package:
DOCKER_BUILDKIT=0 docker build . -t delta-sharing:dev -f docker/Dockerfile
# generate delta-sharing types from proto files
generate:
@buf generate proto
@just delta-sharing/openfga/generate
# run the delta-sharing server with the dev config
do-it:
@RUST_BACKTRACE=1 cargo run -p delta-sharing server --config {{ local_config }}
# the the documentation (requires mdbook)
doc:
cd docs && mdbook serve --open
# load delta acceptance testing (dat) data from the release
[group('dev')]
load-dat:
rm -rf {{ dat_dir }}
curl -OL https://github.com/delta-incubator/dat/releases/download/v{{ dat_version }}/deltalake-dat-v{{ dat_version }}.tar.gz
mkdir -p {{ dat_dir }}
tar --no-same-permissions -xzf deltalake-dat-v{{ dat_version }}.tar.gz --directory {{ dat_dir }}
rm deltalake-dat-v{{ dat_version }}.tar.gz
[group('dev')]
render-config:
DIRECTORY={{ justfile_directory() }} DAT={{ dat_dir }} envsubst < config/local.yaml.tpl > {{ local_config }}
# local setup
[group('dev')]
local-setup: load-dat render-config
[group('dev')]
test-common:
cargo test -p delta-sharing-common
# run the delta-sharing server with the dev config
[group('server')]
rest:
@RUST_LOG=DEBUG cargo run -p delta-sharing rest --config {{ local_config }}
[group('server')]
grpc:
@RUST_LOG=DEBUG cargo run -p delta-sharing grpc --config {{ local_config }}
[group('openfga')]
load-store:
fga store import --file {{ justfile_directory() }}/delta-sharing/openfga/fga/dev.fga.yaml
# Show unused dependencies
udeps:
cargo +nightly udeps