-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
227 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
buildPack: none | ||
pipelineConfig: | ||
pipelines: | ||
pullRequest: | ||
pipeline: | ||
agent: | ||
image: seldonio/core-builder:0.4 | ||
stages: | ||
- name: end-to-end | ||
steps: | ||
- name: test-end-to-end | ||
command: cd | ||
args: | ||
- testing/scripts && | ||
- bash | ||
- kind_test_all.sh | ||
options: | ||
containerOptions: | ||
volumeMounts: | ||
- mountPath: /lib/modules | ||
name: modules | ||
readOnly: true | ||
- mountPath: /sys/fs/cgroup | ||
name: cgroup | ||
- name: dind-storage | ||
mountPath: /var/lib/docker | ||
resources: | ||
requests: | ||
cpu: 2 | ||
memory: 4000Mi | ||
securityContext: | ||
privileged: true | ||
imagePullPolicy: Always | ||
volumes: | ||
- name: modules | ||
hostPath: | ||
path: /lib/modules | ||
type: Directory | ||
- name: cgroup | ||
hostPath: | ||
path: /sys/fs/cgroup | ||
type: Directory | ||
- name: dind-storage | ||
emptyDir: {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
# FIRST WE START THE DOCKER DAEMON | ||
service docker start | ||
# the service can be started but the docker socket not ready, wait for ready | ||
WAIT_N=0 | ||
while true; do | ||
# docker ps -q should only work if the daemon is ready | ||
docker ps -q > /dev/null 2>&1 && break | ||
if [[ ${WAIT_N} -lt 5 ]]; then | ||
WAIT_N=$((WAIT_N+1)) | ||
echo "[SETUP] Waiting for Docker to be ready, sleeping for ${WAIT_N} seconds ..." | ||
sleep ${WAIT_N} | ||
else | ||
echo "[SETUP] Reached maximum attempts, not waiting any longer ..." | ||
break | ||
fi | ||
done | ||
|
||
####################################### | ||
# AVOID EXIT ON ERROR FOR FOLLOWING CMDS | ||
set +o errexit | ||
|
||
# START CLUSTER | ||
make kind_create_cluster | ||
KIND_EXIT_VALUE=$? | ||
|
||
# Ensure we reach the kubeconfig path | ||
export KUBECONFIG=$(kind get kubeconfig-path) | ||
|
||
# ONLY RUN THE FOLLOWING IF SUCCESS | ||
if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then | ||
# BUILD S2I BASE IMAGES | ||
make s2i_build_base_images | ||
S2I_EXIT_VALUE=$? | ||
|
||
# CREATE PROTOS | ||
make build_protos | ||
PROTOS_EXIT_VALUE=$? | ||
|
||
# KIND CLUSTER SETUP | ||
make kind_setup | ||
SETUP_EXIT_VALUE=$? | ||
|
||
## INSTALL ALL REQUIRED DEPENDENCIES | ||
make -C ../../python install-dev | ||
INSTALL_EXIT_VALUE=$? | ||
|
||
## RUNNING TESTS AND CAPTURING ERROR | ||
make test | ||
TEST_EXIT_VALUE=$? | ||
fi | ||
|
||
# DELETE KIND CLUSTER | ||
make kind_delete_cluster | ||
DELETE_EXIT_VALUE=$? | ||
|
||
####################################### | ||
# EXIT STOPS COMMANDS FROM HERE ONWARDS | ||
set -o errexit | ||
|
||
# CLEANING DOCKER | ||
docker ps -aq | xargs -r docker rm -f || true | ||
service docker stop || true | ||
|
||
# NOW THAT WE'VE CLEANED WE CAN EXIT ON TEST EXIT VALUE | ||
exit ${TEST_EXIT_VALUE} | ||
|