-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·66 lines (59 loc) · 1.34 KB
/
entrypoint.sh
File metadata and controls
executable file
·66 lines (59 loc) · 1.34 KB
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
#!/bin/bash
usage() {
cat <<EOF
Usage: entrypoint.sh <command>
Osprey docker entrypoint.
Commands:
osprey-worker
Runs the worker
osprey-ui-api
Runs the Osprey UI API
run-tests
Runs tests for the various projects supported here
operator
Waits.
EOF
exit 1
}
cli-osprey-ui-api() {
exec uv run gunicorn \
--reload \
--access-logfile - \
--error-logfile - \
--logger-class jslog4kube.GunicornLogger \
--name osprey_ui_api \
--worker-class gevent \
--chdir /osprey/osprey_worker/src \
--bind :5004 \
"osprey.worker.ui_api.osprey.app:create_app()"
}
cli-osprey-worker() {
exec uv run python3.11 osprey_worker/src/osprey/worker/cli/sinks.py run-rules-sink
}
cli-run-tests() {
# Only use in CI via harbormaster buildkite run_tests VARIANT PROJECT [directories]
# Docker command will be run-tests --junitxml=/osprey/junit-pytest.xml [directory]
# Last argument is the directory, the rest are pytest args
exec uv run python3.11 -m gevent.monkey --module pytest "${@}"
}
cli-operator() {
while true; do
sleep 600
done
}
cmd="${1:-}"
case "${cmd}" in
"" | "-h" | "--help")
usage
;;
*)
if [[ "$(type -t "cli-${cmd}")" = "function" ]]; then
shift
"cli-${cmd}" "$@"
else
echo "Unknown command: ${cmd}"
echo ""
usage
fi
;;
esac