Skip to content

Commit 1c49e1d

Browse files
author
Miguel Varela Ramos
authored
BatchJob CRD (#2038)
1 parent 615eef1 commit 1c49e1d

File tree

134 files changed

+7090
-2706
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+7090
-2706
lines changed

.circleci/config.yml

+19
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,25 @@ jobs:
8787
go get -u -v golang.org/x/lint/golint
8888
go get -u -v github.com/kyoh86/looppointer/cmd/looppointer
8989
sudo pip install black aiohttp
90+
- run:
91+
name: Initialize Credentials
92+
command: |
93+
echo 'export AWS_ACCESS_KEY_ID=${NIGHTLY_AWS_ACCESS_KEY_ID}' >> $BASH_ENV
94+
echo 'export AWS_SECRET_ACCESS_KEY=${NIGHTLY_AWS_SECRET_ACCESS_KEY}' >> $BASH_ENV
95+
- run:
96+
name: Generate Cluster Config
97+
command: |
98+
mkdir -p dev/config
99+
cat \<< EOF > ./dev/config/cluster.yaml
100+
cluster_name: cortex
101+
region: us-east-1
102+
bucket: cortex-dev-nightly
103+
node_groups:
104+
- name: cpu
105+
instance_type: m5.large
106+
min_instances: 1
107+
max_instances: 1
108+
EOF
90109
- run:
91110
name: Lint
92111
command: make lint

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@
1212
**/*.pyo
1313
**/*.pyd
1414
**/__pycache__/
15+
16+
**/hack/
17+
**/PROJECT
18+
**/Makefile

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/vendor/
22
/bin/
3+
/testbin/
34
/dev/config/
45

56
# PYTHON
@@ -20,3 +21,23 @@ __pycache__/
2021
*.zip
2122
.unison*
2223
.vscode/
24+
25+
# Binaries for programs and plugins
26+
*.exe
27+
*.exe~
28+
*.dll
29+
*.so
30+
*.dylib
31+
32+
# Test binary, build with `go test -c`
33+
*.test
34+
35+
# Kubernetes Generated files - skip generated files, except for vendored files
36+
37+
!vendor/**/zz_generated.*
38+
39+
# editor and IDE paraphernalia
40+
.idea
41+
*.swp
42+
*.swo
43+
*~

build/images.sh

+3
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ dev_images=(
3131
"manager"
3232
"request-monitor"
3333
"async-gateway"
34+
"enqueuer"
3435
)
3536

3637
non_dev_images=(
3738
"tensorflow-serving-cpu"
3839
"tensorflow-serving-gpu"
3940
"cluster-autoscaler"
4041
"operator"
42+
"controller-manager"
4143
"istio-proxy"
4244
"istio-pilot"
4345
"fluent-bit"
@@ -56,6 +58,7 @@ non_dev_images=(
5658
"inferentia"
5759
"neuron-rtd"
5860
"nvidia"
61+
"kubexit"
5962
)
6063

6164
all_images=(

build/lint.sh

+12-5
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ output=$(cd "$ROOT" && find . -type f \
8989
! -path "**/*.egg-info/*" \
9090
! -path "./test/*" \
9191
! -path "./dev/config/*" \
92-
! -path "./bin/*" \
92+
! -path "**/bin/*" \
9393
! -path "./.circleci/*" \
9494
! -path "./.git/*" \
95+
! -path "./pkg/crds/config/*" \
96+
! -path "**/tmp/*" \
9597
! -name LICENSE \
9698
! -name "*requirements.txt" \
9799
! -name "go.*" \
@@ -100,6 +102,7 @@ output=$(cd "$ROOT" && find . -type f \
100102
! -name ".*" \
101103
! -name "*.bin" \
102104
! -name "Dockerfile" \
105+
! -name "PROJECT" \
103106
-exec grep -L "Copyright 2021 Cortex Labs, Inc" {} \;)
104107
if [[ $output ]]; then
105108
echo "File(s) are missing Cortex license:"
@@ -119,7 +122,7 @@ if [ "$is_release_branch" = "true" ]; then
119122
! -path "**/.pytest_cache/*" \
120123
! -path "**/*.egg-info/*" \
121124
! -path "./dev/config/*" \
122-
! -path "./bin/*" \
125+
! -path "**/bin/*" \
123126
! -path "./.git/*" \
124127
! -name ".*" \
125128
! -name "*.bin" \
@@ -142,8 +145,9 @@ output=$(cd "$ROOT" && find . -type f \
142145
! -path "**/.pytest_cache/*" \
143146
! -path "**/*.egg-info/*" \
144147
! -path "./dev/config/*" \
145-
! -path "./bin/*" \
148+
! -path "**/bin/*" \
146149
! -path "./.git/*" \
150+
! -path "./pkg/crds/config/*" \
147151
! -name ".*" \
148152
! -name "*.bin" \
149153
! -name "*.wav" \
@@ -164,7 +168,8 @@ output=$(cd "$ROOT" && find . -type f \
164168
! -path "**/.pytest_cache/*" \
165169
! -path "**/*.egg-info/*" \
166170
! -path "./dev/config/*" \
167-
! -path "./bin/*" \
171+
! -path "./pkg/crds/config/*" \
172+
! -path "**/bin/*" \
168173
! -path "./.git/*" \
169174
! -name ".*" \
170175
! -name "*.bin" \
@@ -187,7 +192,7 @@ output=$(cd "$ROOT" && find . -type f \
187192
! -path "**/.pytest_cache/*" \
188193
! -path "**/*.egg-info/*" \
189194
! -path "./dev/config/*" \
190-
! -path "./bin/*" \
195+
! -path "**/bin/*" \
191196
! -path "./.git/*" \
192197
! -name ".*" \
193198
! -name "*.bin" \
@@ -209,11 +214,13 @@ output=$(cd "$ROOT" && find . -type f \
209214
! -path "**/.pytest_cache/*" \
210215
! -path "**/*.egg-info/*" \
211216
! -path "./dev/config/*" \
217+
! -path "./pkg/crds/config/*" \
212218
! -path "./bin/*" \
213219
! -path "./.git/*" \
214220
! -name ".*" \
215221
! -name "*.bin" \
216222
! -name "*.wav" \
223+
! -name "boilerplate.go.txt" \
217224
-print0 | \
218225
xargs -0 -L1 bash -c 'test "$(head -c 1 "$0")" || [ ! -s "$0" ] || echo "New line at beginning of $0"' || true)
219226
if [[ $output ]]; then

build/test.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
set -euo pipefail
1919

2020
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)"
21+
ENVTEST_ASSETS_DIR=${ROOT}/testbin
2122

2223
cluster_env="undefined"
2324
create_cluster="no"
@@ -69,7 +70,13 @@ cmd=${1:-""}
6970
sub_cmd=${2:-""}
7071

7172
function run_go_tests() {
72-
(cd $ROOT && go test ./... && echo "go tests passed")
73+
(
74+
cd $ROOT
75+
mkdir -p ${ENVTEST_ASSETS_DIR}
76+
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.2/hack/setup-envtest.sh
77+
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools ${ENVTEST_ASSETS_DIR}; setup_envtest_env ${ENVTEST_ASSETS_DIR}
78+
go test ./... && echo "go tests passed"
79+
)
7380
}
7481

7582
function run_python_tests() {

docs/clusters/management/create.md

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ The docker images used by the cluster can also be overridden. They can be config
9797
<!-- CORTEX_VERSION_BRANCH_STABLE -->
9898
```yaml
9999
image_operator: quay.io/cortexlabs/operator:master
100+
image_controller_manager: quay.io/cortexlabs/controller-manager:master
100101
image_manager: quay.io/cortexlabs/manager:master
101102
image_downloader: quay.io/cortexlabs/downloader:master
102103
image_request_monitor: quay.io/cortexlabs/request-monitor:master
@@ -119,4 +120,6 @@ image_prometheus_node_exporter: quay.io/cortexlabs/prometheus-node-exporter:mast
119120
image_kube_rbac_proxy: quay.io/cortexlabs/kube-rbac-proxy:master
120121
image_grafana: quay.io/cortexlabs/grafana:master
121122
image_event_exporter: quay.io/cortexlabs/event-exporter:master
123+
image_enqueuer: quay.io/cortexlabs/enqueuer:master
124+
image_kubexit: quay.io/cortexlabs/kubexit:master
122125
```

0 commit comments

Comments
 (0)