Skip to content

Commit

Permalink
Merge pull request #3387 from datawire/acookin/push-oss
Browse files Browse the repository at this point in the history
Acookin/push oss
  • Loading branch information
acookin authored May 4, 2021
2 parents 48a1bb0 + ab01aa7 commit 98b1e4d
Show file tree
Hide file tree
Showing 50 changed files with 643 additions and 5,759 deletions.
13 changes: 12 additions & 1 deletion .ci/cluster-claim
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ set -o errexit
set -o nounset
set -o xtrace

if [ -n "${USE_LOCAL_K3S_CLUSTER:-}" ] ; then
mkdir -p ~/.kube
export DEV_KUBECONFIG=~/.kube/kubeception.yaml
touch ${DEV_KUBECONFIG}
if [ -z "${K3S_CLUSTER_NAME:-}" ] ; then
K3S_CLUSTER_NAME=amb-ci
fi
KUBECONFIG=${DEV_KUBECONFIG} k3d cluster create ${K3S_CLUSTER_NAME} --k3s-server-arg "--no-deploy=traefik"
exit 0
fi

if [ -n "${KUBECEPTION_TOKEN}" ]; then

trap push_metrics EXIT
Expand All @@ -52,7 +63,7 @@ if [ -n "${KUBECEPTION_TOKEN}" ]; then
tries=0
while true ; do
# get a kluster with a 1-hour timeout (by default) that is size "large" (by default)
get_cluster ${DEV_KUBECONFIG} ${KUBECEPTION_TIMEOUT:-3600} ${KUBECEPTION_PROFILE:-large}
get_cluster ${DEV_KUBECONFIG} ${KUBECEPTION_TIMEOUT:-3600} ${KUBECEPTION_PROFILE:-large} ${KUBECEPTION_VERSION:-1.19}
ret=$?
if [ "$ret" == "0" ] ; then
wait_for_kubeconfig ${DEV_KUBECONFIG}
Expand Down
123 changes: 112 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,45 @@ commands:
# teardown
- dirty-check
- amb-images-save-workspace
"job-gotest":
parameters:
"fast-reconfigure":
type: boolean
default: false
"legacy-mode":
type: boolean
default: false
steps:
# setup
- amb-linux-install
- install-gotestsum
- amb-checkout
- skip-if-only-changes:
to: docs/
- amb-config-registry
- run:
name: "Test"
no_output_timeout: "30m"
command: |
export DEV_KUBE_NO_PVC=yes
export KAT_REQ_LIMIT=900
export AMBASSADOR_LEGACY_MODE=<< parameters.legacy-mode >> # ParseBool
export AMBASSADOR_FAST_RECONFIGURE=<< parameters.fast-reconfigure >> # ParseBool
export TEST_XML_DIR=/tmp/test-logs/xml/
mkdir -p ${TEST_XML_DIR}
make gotest
# teardown
- amb-save-logs
- store_test_results:
path: /tmp/test-logs/xml/
- dirty-check
"job-test":
parameters:
"test":
type: enum
enum:
- "test" # everything but pytest-envoy
- "ingresstest"
- "gotest"
- "pytest"
- "pytest-envoy"
- "pytest-envoy-v3"
Expand All @@ -131,6 +162,8 @@ commands:
steps:
- skip-if-only-changes:
to: "(ambassador/|tests/pytest/gold/)"
- run: |
echo >>"$BASH_ENV" 'export USE_LOCAL_K3S_CLUSTER=1'
- when:
condition:
or:
Expand All @@ -150,6 +183,8 @@ commands:
# time it still runs OK if there's plenty of RAM.
run: |
echo >>"$BASH_ENV" 'export KUBECEPTION_PROFILE=large'
- install-helm
- install-k3d
- amb-config-cluster-and-registry
- # main
run:
Expand Down Expand Up @@ -433,6 +468,19 @@ commands:
- amb-checkout
- skip-if-no-changes:
to: docs/
install-gotestsum:
steps:
- run:
name: "Install gotestsum"
command: |
go get gotest.tools/gotestsum
install-redis:
steps:
- run:
name: "Install Redis"
command: |
sudo apt update -y
sudo apt install -y redis-server
install-k3d:
parameters:
version:
Expand Down Expand Up @@ -641,6 +689,19 @@ jobs:
steps:
- job-images:
release: << parameters.release >>
oss-gotest:
executor: oss-linux
parameters:
fast-reconfigure:
type: boolean
default: false
legacy-mode:
type: boolean
default: false
steps:
- job-gotest:
fast-reconfigure: << parameters.fast-reconfigure >>
legacy-mode: << parameters.legacy-mode >>
oss-test:
executor: oss-linux
parameters:
Expand All @@ -649,7 +710,6 @@ jobs:
enum:
- "test" # everything but pytest-envoy
- "ingresstest"
- "gotest"
- "pytest"
- "pytest-envoy"
- "pytest-envoy-v3"
Expand Down Expand Up @@ -758,6 +818,19 @@ workflows:
name: "oss-dev-lint"
- oss-chart:
name: "oss-dev-chart"
- oss-gotest:
name: "oss-dev-gotest<<# matrix.fast-reconfigure >>-fastreconfigure<</ matrix.fast-reconfigure
>><<# matrix.legacy-mode >>-legacy<</ matrix.legacy-mode >>"
matrix:
alias: "oss-dev-gotest"
parameters:
fast-reconfigure:
- true
- false
legacy-mode:
- false
# If you enable testing with legacy-mode true as well, you'll also need
# to add some exclusions -- see the Release workflow for more.
- oss-test:
requires:
- "oss-dev-images"
Expand All @@ -768,7 +841,6 @@ workflows:
alias: "oss-dev-test"
parameters:
test:
- "gotest"
- "pytest"
- "pytest-envoy"
- "pytest-envoy-v3"
Expand Down Expand Up @@ -834,6 +906,27 @@ workflows:
only: /^v[0-9]+\.[0-9]+\.[0-9]+-(rc|ea)\.[0-9]+$/
branches:
ignore: /.*/
- oss-gotest:
name: "oss-release-gotest<<# matrix.fast-reconfigure >>-fastreconfigure<</
matrix.fast-reconfigure >><<# matrix.legacy-mode >>-legacy<</ matrix.legacy-mode
>>"
matrix:
alias: "oss-release-gotest"
parameters:
fast-reconfigure:
- true
- false
legacy-mode:
- true
- false
exclude:
- fast-reconfigure: true
legacy-mode: true
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+-(rc|ea)\.[0-9]+$/
branches:
ignore: /.*/
- oss-test:
requires:
- "oss-release-images"
Expand All @@ -844,7 +937,6 @@ workflows:
alias: "oss-release-test"
parameters:
test:
- "gotest"
- "pytest"
- "pytest-envoy"
- "pytest-envoy-v3"
Expand All @@ -861,9 +953,6 @@ workflows:
- true
- false
exclude:
- test: gotest
fast-reconfigure: true
legacy-mode: true
- test: pytest
fast-reconfigure: true
legacy-mode: true
Expand Down Expand Up @@ -907,6 +996,22 @@ workflows:
jobs:
- oss-images:
name: "oss-nightly-images"
- oss-gotest:
name: "oss-nightly-gotest<<# matrix.fast-reconfigure >>-fastreconfigure<</
matrix.fast-reconfigure >><<# matrix.legacy-mode >>-legacy<</ matrix.legacy-mode
>>"
matrix:
alias: "oss-nightly-gotest"
parameters:
fast-reconfigure:
- true
- false
legacy-mode:
- true
- false
exclude:
- fast-reconfigure: true
legacy-mode: true
- oss-test:
requires:
- "oss-nightly-images"
Expand All @@ -917,7 +1022,6 @@ workflows:
alias: "oss-nightly-test"
parameters:
test:
- "gotest"
- "pytest"
- "pytest-envoy"
# Running the ingresstests would require we install `kind` and
Expand All @@ -933,9 +1037,6 @@ workflows:
- true
- false
exclude:
- test: gotest
fast-reconfigure: true
legacy-mode: true
- test: pytest
fast-reconfigure: true
legacy-mode: true
Expand Down
40 changes: 38 additions & 2 deletions .circleci/config.yml.d/amb_jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,47 @@ commands:
- dirty-check
- amb-images-save-workspace

"job-gotest":
parameters:
"fast-reconfigure":
type: boolean
default: false
"legacy-mode":
type: boolean
default: false
steps:
# setup
- amb-linux-install
- install-gotestsum
- amb-checkout
- skip-if-only-changes:
to: docs/
- amb-config-registry
- run:
name: "Test"
no_output_timeout: "30m"
command: |
export DEV_KUBE_NO_PVC=yes
export KAT_REQ_LIMIT=900
export AMBASSADOR_LEGACY_MODE=<< parameters.legacy-mode >> # ParseBool
export AMBASSADOR_FAST_RECONFIGURE=<< parameters.fast-reconfigure >> # ParseBool
export TEST_XML_DIR=/tmp/test-logs/xml/
mkdir -p ${TEST_XML_DIR}
make gotest
# teardown
- amb-save-logs
- store_test_results:
path: /tmp/test-logs/xml/
- dirty-check

"job-test":
parameters:
"test":
type: enum
enum:
- "test" # everything but pytest-envoy
- "ingresstest"
- "gotest"
- "pytest"
- "pytest-envoy"
- "pytest-envoy-v3"
Expand All @@ -142,6 +175,8 @@ commands:
steps:
- skip-if-only-changes:
to: "(ambassador/|tests/pytest/gold/)"
- run: |
echo >>"$BASH_ENV" 'export USE_LOCAL_K3S_CLUSTER=1'
- when:
condition:
or:
Expand All @@ -161,8 +196,9 @@ commands:
# time it still runs OK if there's plenty of RAM.
- run: |
echo >>"$BASH_ENV" 'export KUBECEPTION_PROFILE=large'
- install-helm
- install-k3d
- amb-config-cluster-and-registry

# main
- run:
name: "Ensure CI configuration is up-to-date"
Expand Down
Loading

0 comments on commit 98b1e4d

Please sign in to comment.