diff --git a/.circleci/config.yml b/.circleci/config.yml index 17b42d7c24..991a2b25ad 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -121,7 +121,7 @@ jobs: - checkout - setup_remote_docker - install-go - - run: sudo apt update && sudo apt install parallel -y + - run: docker buildx create --name builder --platform linux/amd64,linux/arm64 --use && docker buildx inspect --bootstrap - run: sudo pip install awscli - run: make ci-build-cli - return-if-not-deployed-branch @@ -174,6 +174,10 @@ jobs: instance_type: inf1.xlarge min_instances: 1 max_instances: 2 + - name: arm + instance_type: a1.large + min_instances: 1 + max_instances: 2 EOF - run: name: Create/Update AWS User policy diff --git a/Makefile b/Makefile index 1461188697..915936afe0 100644 --- a/Makefile +++ b/Makefile @@ -127,17 +127,24 @@ async-gateway-update: # docker images images-all: @./dev/registry.sh update all +images-all-multi-arch: + @./dev/registry.sh update all --include-arm64-arch images-all-skip-push: @./dev/registry.sh update all --skip-push images-dev: @./dev/registry.sh update dev +images-dev-multi-arch: + @./dev/registry.sh update dev --include-arm64-arch images-dev-skip-push: @./dev/registry.sh update dev --skip-push images-manager-skip-push: @./dev/registry.sh update-single manager --skip-push +images-clean-cache: + @./dev/registry.sh clean-cache + registry-create: @./dev/registry.sh create @@ -151,7 +158,6 @@ tools: @go get -u -v github.com/kyoh86/looppointer/cmd/looppointer @go get -u -v github.com/VojtechVitek/rerun/cmd/rerun @go get -u -v github.com/go-delve/delve/cmd/dlv - @if [[ "$$OSTYPE" == "darwin"* ]]; then brew install parallel; elif [[ "$$OSTYPE" == "linux"* ]]; then sudo apt-get install -y parallel; else echo "your operating system is not supported"; fi @python3 -m pip install aiohttp black 'pydoc-markdown>=3.0.0,<4.0.0' boto3 pyyaml @python3 -m pip install -e test/e2e diff --git a/build/build-image.sh b/build/build-image.sh index 42fcee6933..352582e251 100755 --- a/build/build-image.sh +++ b/build/build-image.sh @@ -22,8 +22,9 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)" CORTEX_VERSION=master image=$1 +platforms=$2 if [ "$image" == "inferentia" ]; then aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 790709498068.dkr.ecr.us-west-2.amazonaws.com fi -docker build "$ROOT" -f $ROOT/images/$image/Dockerfile -t quay.io/cortexlabs/${image}:${CORTEX_VERSION} -t cortexlabs/${image}:${CORTEX_VERSION} +docker buildx build $ROOT -f $ROOT/images/$image/Dockerfile -t quay.io/cortexlabs/${image}:${CORTEX_VERSION} -t cortexlabs/${image}:${CORTEX_VERSION} --platform $platforms diff --git a/build/build-images.sh b/build/build-images.sh index 7615d38e50..f3dd265982 100755 --- a/build/build-images.sh +++ b/build/build-images.sh @@ -22,11 +22,10 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)" source $ROOT/build/images.sh source $ROOT/dev/util.sh -# if parallel utility is installed, the docker build commands will be parallelized -if command -v parallel &> /dev/null && [ -n "${NUM_BUILD_PROCS+set}" ] && [ "$NUM_BUILD_PROCS" != "1" ]; then - ROOT=$ROOT SHELL=$(type -p /bin/bash) parallel --will-cite --halt now,fail=1 --eta --jobs $NUM_BUILD_PROCS $ROOT/build/build-image.sh {} ::: "${all_images[@]}" -else - for image in "${all_images[@]}"; do - $ROOT/build/build-image.sh $image - done -fi +for image in "${all_images[@]}"; do + platforms="linux/amd64" + if in_array $image "multi_arch_images"; then + platforms+=",linux/arm64" + fi + $ROOT/build/build-image.sh $image $platforms +done diff --git a/build/generate_ami_mapping.go b/build/generate_ami_mapping.go index 14a8ab25d3..83e39df95f 100644 --- a/build/generate_ami_mapping.go +++ b/build/generate_ami_mapping.go @@ -235,11 +235,15 @@ func main() { fmt.Print(region) sess := session.New(&aws.Config{Region: aws.String(region)}) svc := ec2.New(sess) - cpuAMI, err := FindImage(svc, EKSResourceAccountID(region), fmt.Sprintf("amazon-eks-node-%s-v*", k8sVersion)) + cpuAmd64AMI, err := FindImage(svc, EKSResourceAccountID(region), fmt.Sprintf("amazon-eks-node-%s-v*", k8sVersion)) if err != nil { log.Fatal(err.Error()) } - acceleratedAMI, err := FindImage(svc, EKSResourceAccountID(region), fmt.Sprintf("amazon-eks-gpu-node-%s-v*", k8sVersion)) + cpuArm64AMI, err := FindImage(svc, EKSResourceAccountID(region), fmt.Sprintf("amazon-eks-arm64-node-%s-v*", k8sVersion)) + if err != nil { + log.Fatal(err.Error()) + } + acceleratedAmd64AMI, err := FindImage(svc, EKSResourceAccountID(region), fmt.Sprintf("amazon-eks-gpu-node-%s-v*", k8sVersion)) if err != nil { log.Fatal(err.Error()) } @@ -248,8 +252,9 @@ func main() { k8sVersionMap[k8sVersion][region] = map[string]string{} } k8sVersionMap[k8sVersion][region] = map[string]string{ - "cpu": cpuAMI, - "accelerated": acceleratedAMI, + "cpu_amd64": cpuAmd64AMI, + "cpu_arm64": cpuArm64AMI, + "accelerated_amd64": acceleratedAmd64AMI, } fmt.Println(" ✓") } diff --git a/build/images.sh b/build/images.sh index ca07560b3b..32a3f1b661 100644 --- a/build/images.sh +++ b/build/images.sh @@ -50,6 +50,18 @@ non_dev_images=( "kubexit" ) +# for linux/amd64 and linux/arm64 +multi_arch_images=( + "proxy" + "async-gateway" + "enqueuer" + "dequeuer" + "fluent-bit" + "prometheus-node-exporter" + "kube-rbac-proxy" + "kubexit" +) + all_images=( "${dev_images[@]}" "${non_dev_images[@]}" diff --git a/build/push-image.sh b/build/push-image.sh index b87ccec98f..35c6bbc422 100755 --- a/build/push-image.sh +++ b/build/push-image.sh @@ -17,10 +17,13 @@ set -euo pipefail +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)" + CORTEX_VERSION=master host=$1 image=$2 +platforms=$3 echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin -docker push $host/cortexlabs/${image}:${CORTEX_VERSION} +docker buildx build $ROOT -f $ROOT/images/$image/Dockerfile $host/cortexlabs/${image}:${CORTEX_VERSION} --platform $platforms --push diff --git a/build/push-images.sh b/build/push-images.sh index 59ebf75b71..75c5b73677 100755 --- a/build/push-images.sh +++ b/build/push-images.sh @@ -24,11 +24,10 @@ source $ROOT/dev/util.sh host=$1 -# if parallel utility is installed, the docker push commands will be parallelized -if command -v parallel &> /dev/null && [ -n "${NUM_BUILD_PROCS+set}" ] && [ "$NUM_BUILD_PROCS" != "1" ]; then - ROOT=$ROOT DOCKER_USERNAME=$DOCKER_USERNAME DOCKER_PASSWORD=$DOCKER_PASSWORD SHELL=$(type -p /bin/bash) parallel --will-cite --halt now,fail=1 --eta --jobs $NUM_BUILD_PROCS $ROOT/build/push-image.sh $host {} ::: "${all_images[@]}" -else - for image in "${all_images[@]}"; do - $ROOT/build/push-image.sh $host $image - done -fi +for image in "${all_images[@]}"; do + platforms="linux/amd64" + if in_array $image "multi_arch_images"; then + platforms+=",linux/arm64" + fi + $ROOT/build/push-image.sh $host $image $platforms +done diff --git a/dev/registry.sh b/dev/registry.sh index f8e7312dc3..ef027233bb 100755 --- a/dev/registry.sh +++ b/dev/registry.sh @@ -23,7 +23,7 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)" source $ROOT/build/images.sh source $ROOT/dev/util.sh -images_with_builders="operator proxy async-gateway enqueuer dequeuer controller-manager" +images_that_can_run_locally="operator manager" if [ -f "$ROOT/dev/config/env.sh" ]; then source $ROOT/dev/config/env.sh @@ -33,6 +33,7 @@ AWS_ACCOUNT_ID=${AWS_ACCOUNT_ID:-} AWS_REGION=${AWS_REGION:-} skip_push="false" +include_arm64_arch="false" positional_args=() while [[ $# -gt 0 ]]; do key="$1" @@ -41,6 +42,10 @@ while [[ $# -gt 0 ]]; do skip_push="true" shift ;; + --include-arm64-arch) + include_arm64_arch="true" + shift + ;; *) positional_args+=("$1") shift @@ -105,59 +110,55 @@ function create_ecr_repository() { ### HELPERS ### -function build() { - local image=$1 - local tag=$2 - local dir="${ROOT}/images/${image}" - - tag_args="" - if [ -n "$AWS_ACCOUNT_ID" ] && [ -n "$AWS_REGION" ]; then - tag_args+=" -t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/cortexlabs/$image:$tag" - fi - - blue_echo "Building $image:$tag..." - docker build $ROOT -f $dir/Dockerfile -t cortexlabs/$image:$tag $tag_args - green_echo "Built $image:$tag\n" -} - -function cache_builder() { +function build_and_push() { local image=$1 + local include_arm64_arch=$2 local dir="${ROOT}/images/${image}" - blue_echo "Building $image-builder..." - docker build $ROOT -f $dir/Dockerfile -t cortexlabs/$image-builder:$CORTEX_VERSION --target builder - green_echo "Built $image-builder\n" -} + set -euo pipefail -function push() { - if [ "$skip_push" = "true" ]; then - return + if ! in_array $image "multi_arch_images"; then + include_arm64_arch="false" fi + if [ ! -n "$AWS_ACCOUNT_ID" ] || [ ! -n "$AWS_REGION" ]; then + echo "AWS_ACCOUNT_ID or AWS_REGION env vars not found" + exit 1 + fi registry_login - local image=$1 - local tag=$2 + tag=$CORTEX_VERSION + if [ "$include_arm64_arch" = "true" ]; then + blue_echo "Building and pushing $image:$tag (amd64 and arm64)..." + else + blue_echo "Building and pushing $image:$tag (amd64)..." + fi - blue_echo "Pushing $image:$tag..." - docker push $registry_push_url/cortexlabs/$image:$tag - green_echo "Pushed $image:$tag\n" -} + platforms="linux/amd64" + if [ "$include_arm64_arch" = "true" ]; then + platforms+=",linux/arm64" + fi -function build_and_push() { - local image=$1 + docker buildx build $ROOT -f $dir/Dockerfile -t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/cortexlabs/$image:$tag --platform $platforms --push - set -euo pipefail # necessary since this is called in a new shell by parallel + if [ "$include_arm64_arch" = "true" ]; then + green_echo "Built and pushed $image:$tag (amd64 and arm64)..." + else + green_echo "Built and pushed $image:$tag (amd64)..." + fi - tag=$CORTEX_VERSION - build $image $tag - push $image $tag + if [[ " $images_that_can_run_locally " =~ " $image " ]] && [[ "$include_arm64_arch" == "false" ]]; then + blue_echo "Exporting $image:$tag to local docker..." + docker buildx build $ROOT -f $dir/Dockerfile -t cortexlabs/$image:$tag -t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/cortexlabs/$image:$tag --platform $platforms --load + green_echo "Exported $image:$tag to local docker..." + fi } function cleanup_local() { echo "cleaning local repositories..." docker container prune -f docker image prune -f + docker buildx prune -f } function cleanup_ecr() { @@ -195,14 +196,6 @@ function validate_env() { fi } -# export functions for parallel command -export -f build_and_push -export -f push -export -f build -export -f blue_echo -export -f green_echo -export -f registry_login - # validate environment is correctly set on env.sh validate_env @@ -218,13 +211,9 @@ elif [ "$cmd" = "create" ]; then # usage: registry.sh update-single IMAGE elif [ "$cmd" = "update-single" ]; then image=$sub_cmd - if [[ " $images_with_builders " =~ " $image " ]]; then - cache_builder $image - fi - build_and_push $image + build_and_push $image $include_arm64_arch # usage: registry.sh update all|dev|api -# if parallel utility is installed, the docker build commands will be parallelized elif [ "$cmd" = "update" ]; then images_to_build=() @@ -236,20 +225,12 @@ elif [ "$cmd" = "update" ]; then images_to_build+=( "${dev_images[@]}" ) fi - for image in $images_with_builders; do - if [[ " ${images_to_build[@]} " =~ " $image " ]]; then - cache_builder $image - fi + for image in "${images_to_build[@]}"; do + build_and_push $image $include_arm64_arch done - if command -v parallel &> /dev/null && [ -n "${NUM_BUILD_PROCS+set}" ] && [ "$NUM_BUILD_PROCS" != "1" ]; then - is_registry_logged_in=$is_registry_logged_in ROOT=$ROOT registry_push_url=$registry_push_url SHELL=$(type -p /bin/bash) parallel --will-cite --halt now,fail=1 --eta --jobs $NUM_BUILD_PROCS build_and_push "{}" ::: "${images_to_build[@]}" - else - for image in "${images_to_build[@]}"; do - build_and_push $image - done - fi - +# usage: registry.sh clean-cache +elif [ "$cmd" = "clean-cache" ]; then cleanup_local else diff --git a/dev/util.sh b/dev/util.sh index 9595ecc381..1d3fcea532 100755 --- a/dev/util.sh +++ b/dev/util.sh @@ -45,3 +45,13 @@ function join_by() { done echo } + +# Check if array contains item [$1: item, $2: array name] +function in_array() { + local needle="$1" item + local -n arrref="$2" + for item in "${arrref[@]}"; do + [[ "${item}" == "${needle}" ]] && return 0 + done + return 1 +} diff --git a/dev/versions.md b/dev/versions.md index 01173ef192..d355c6741c 100644 --- a/dev/versions.md +++ b/dev/versions.md @@ -25,8 +25,8 @@ 1. If there are new instance types, check if any changes need to be made to `servicequotas.go` or `validateInstanceType()`. ```bash -PREV_RELEASE=1.7.5 -NEW_RELEASE=1.7.10 +PREV_RELEASE=1.7.10 +NEW_RELEASE=1.8.0 wget -q -O cni_supported_instances_prev.txt https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/v${PREV_RELEASE}/pkg/awsutils/vpc_ip_resource_limit.go; wget -q -O cni_supported_instances_new.txt https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/v${NEW_RELEASE}/pkg/awsutils/vpc_ip_resource_limit.go; git diff --no-index cni_supported_instances_prev.txt cni_supported_instances_new.txt; rm -rf cni_supported_instances_prev.txt; rm -rf cni_supported_instances_new.txt ``` @@ -96,7 +96,7 @@ see https://github.com/moby/moby/issues/39302#issuecomment-639687466_ 1. `rm -rf go.mod go.sum && go mod init && go clean -modcache` 1. `go get k8s.io/client-go@v0.17.6 && go get k8s.io/apimachinery@v0.17.6 && go get k8s.io/api@v0.17.6` 1. `go get istio.io/client-go@1.7.3 && go get istio.io/api@1.7.3` -1. `go get github.com/aws/amazon-vpc-cni-k8s/pkg/awsutils@v1.7.10` +1. `go get github.com/aws/amazon-vpc-cni-k8s/pkg/awsutils@v1.8.0` 1. `go get github.com/cortexlabs/yaml@581aea36a2e4db10f8696587e48cac5248d64f4d` 1. `go get github.com/cortexlabs/go-input@8b67a7a7b28d1c45f5c588171b3b50148462b247` 1. `echo -e '\nreplace github.com/docker/docker => github.com/docker/engine v19.03.12' >> go.mod` diff --git a/go.mod b/go.mod index 596c2b9f32..7786a3a510 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( cloud.google.com/go v0.73.0 // indirect github.com/DataDog/datadog-go v4.7.0+incompatible github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect - github.com/aws/amazon-vpc-cni-k8s v1.7.10 + github.com/aws/amazon-vpc-cni-k8s v1.8.0 github.com/aws/aws-sdk-go v1.37.23 github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/containerd/containerd v1.4.3 // indirect diff --git a/go.sum b/go.sum index db7dcd0239..bf1e4681d0 100644 --- a/go.sum +++ b/go.sum @@ -94,8 +94,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/amazon-vpc-cni-k8s v1.7.10 h1:KW0S2QXUGmaHOwqgsd2QdLJUDrknDq4mRRSEu1zMUTs= -github.com/aws/amazon-vpc-cni-k8s v1.7.10/go.mod h1:DvKcToLCSKRXnnoIE5u1Bphq97bdCw0KP33JA//JP0I= +github.com/aws/amazon-vpc-cni-k8s v1.8.0 h1:YVteZl3WkKoe554gkmFVUvR9/CliamTXRSsJaE1neno= +github.com/aws/amazon-vpc-cni-k8s v1.8.0/go.mod h1:p7GsqsIcTy/IN/zOK2k2GKg1nd1Z/1t0ydTTVY80zV8= github.com/aws/aws-sdk-go v1.37.23 h1:bO80NcSmRv52w+GFpBegoLdlP/Z0OwUqQ9bbeCLCy/0= github.com/aws/aws-sdk-go v1.37.23/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= @@ -128,7 +128,6 @@ github.com/containerd/containerd v1.4.3 h1:ijQT13JedHSHrQGWFcGEwzcNKrAGIiZ+jSD5Q github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/plugins v0.9.0/go.mod h1:dbWv4dI0QrBGuVgj+TuVQ6wJRZVOhrCQj91YyC92sxg= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -142,6 +141,7 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cortexlabs/go-input v0.0.0-20200503032952-8b67a7a7b28d h1:2SmODObcy2ekPA0eLFlR/+Vu5Yo2hoVbNMJ+vWzinpo= github.com/cortexlabs/go-input v0.0.0-20200503032952-8b67a7a7b28d/go.mod h1:rxijm42+fHjyPbFGqUTzUUhioEVg5LUi+w53dlY0WUM= @@ -158,7 +158,6 @@ github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/ github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -232,6 +231,7 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= @@ -339,12 +339,10 @@ github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-jsonnet v0.16.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= +github.com/google/gopacket v1.1.18/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -364,10 +362,9 @@ github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= @@ -416,7 +413,7 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.10 h1:6q5mVkdH/vYmqngx7kZQTjJ5HRsx+ImorDIEQ+beJgc= github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= @@ -433,8 +430,6 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -517,7 +512,6 @@ github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXy github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -557,7 +551,6 @@ github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVo github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v1.0.0-rc9 h1:/k06BMULKF5hidyoZymkoDCzdJzltZpz/UU4LguQVtc= github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/operator-framework/operator-sdk v0.0.7/go.mod h1:iVyukRkam5JZa8AnjYf+/G3rk7JI1+M6GsU0sq0B9NA= github.com/ory/dockertest/v3 v3.6.5 h1:mhNKFeVEHuvaYW+/u+59mLzM/6XXGjpaet/yApgv+yc= github.com/ory/dockertest/v3 v3.6.5/go.mod h1:iYKQSRlYrt/2s5fJWYdB98kCQG6g/LjBMvzEYii63vg= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -572,12 +565,10 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -588,16 +579,15 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= @@ -650,7 +640,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -698,6 +687,7 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5/go.mod h1:skWido08r9w6Lq/w70DO5XYIKMu4QFu1+4VsqLQuJy8= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= @@ -941,6 +931,7 @@ golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -976,6 +967,7 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201202200335-bef1c476418a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210113180300-f96436850f18/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -983,6 +975,7 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.1.0 h1:Phva6wqu+xR//Njw6iorylFFgn/z547tw5Ne3HZPQ+k= gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -1137,26 +1130,31 @@ istio.io/client-go v0.0.0-20200807182027-d287a5abb594 h1:Rdokv2iBpeIgsER6tas937Q istio.io/client-go v0.0.0-20200807182027-d287a5abb594/go.mod h1:q726ySPDHo2Ob6LHZ9oXWr8nNf8Sm0uIzYQ7B4XjnvA= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a h1:w7zILua2dnYo9CxImhpNW4NE/8ZxEoc/wfBfHrhUhrE= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= -k8s.io/api v0.0.0-20180712090710-2d6f90ab1293/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.18.1/go.mod h1:3My4jorQWzSs5a+l7Ge6JBbIxChLnY8HnuT58ZWolss= +k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= k8s.io/api v0.19.2 h1:q+/krnHWKsL7OBZg/rxnycsl9569Pud76UJ77MvKXms= k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI= +k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= k8s.io/apiextensions-apiserver v0.19.2 h1:oG84UwiDsVDu7dlsGQs5GySmQHCzMhknfhFExJMz9tA= k8s.io/apiextensions-apiserver v0.19.2/go.mod h1:EYNjpqIAvNZe+svXVx9j4uBaVhTB4C94HkY3w058qcg= -k8s.io/apimachinery v0.0.0-20180621070125-103fd098999d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= +k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.19.2 h1:5Gy9vQpAGTKHPVOh5c4plE274X8D/6cuEiTO2zve7tc= k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/apiserver v0.18.6/go.mod h1:Zt2XvTHuaZjBz6EFYzpp+X4hTmgWGy8AthNVnTdm3Wg= k8s.io/apiserver v0.19.2/go.mod h1:FreAq0bJ2vtZFj9Ago/X0oNGC51GfubKK/ViOKfVAOA= -k8s.io/client-go v0.0.0-20180806134042-1f13a808da65/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/client-go v0.18.1/go.mod h1:iCikYRiXOj/yRRFE/aWqrpPtDt4P2JVWhtHkmESTcfY= +k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= +k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= +k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= k8s.io/component-base v0.19.2 h1:jW5Y9RcZTb79liEhW3XDVTW7MuvEGP0tQZnfSX6/+gs= k8s.io/component-base v0.19.2/go.mod h1:g5LrsiTiabMLZ40AR6Hl45f088DevyGY+cCE2agEIVo= k8s.io/cri-api v0.0.0-20191107035106-03d130a7dc28/go.mod h1:9a7E6pmKLfuq8ZL31k2PDpgvSdyZfUOH9czlEmpblFk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -1166,22 +1164,23 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-openapi v0.0.0-20190510232812-a01b7d5d6c22/go.mod h1:iU+ZGYsNlvU9XKUSso6SQfKTCCw7lFduMZy26Mgr2Fw= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL1egv36TkkJm+bA8AxicmQ= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20200912215256-4140de9c8800 h1:9ZNvfPvVIEsp/T1ez4GQuzCcCTEQWhovSofhqR73A6g= k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.9/go.mod h1:dzAXnQbTRyDlZPJX2SUPEqvnB+j7AJjtlox7PEwigU0= +sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY= sigs.k8s.io/controller-runtime v0.7.2 h1:gD2JZp0bBLLuvSRYVNvox+bRCz1UUUxKDjPUCb56Ukk= sigs.k8s.io/controller-runtime v0.7.2/go.mod h1:pJ3YBrJiAqMAZKi6UVGuE98ZrroV1p+pIhoHsMm9wdU= -sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65 h1:xJNnO2qzHtgVCSPoGkkltSpyEX7D7IJw1TmbE3G/7lY= -sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= diff --git a/images/async-gateway/Dockerfile b/images/async-gateway/Dockerfile index 6eae9ad24f..94ec94c6f5 100644 --- a/images/async-gateway/Dockerfile +++ b/images/async-gateway/Dockerfile @@ -1,3 +1,5 @@ +ARG TARGETARCH, TARGETOS + FROM golang:1.15 as builder COPY go.mod go.sum /workspace/ @@ -10,7 +12,7 @@ COPY pkg/async-gateway pkg/async-gateway COPY pkg/types pkg/types COPY cmd/async-gateway cmd/async-gateway -RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o async-gateway ./cmd/async-gateway +RUN GO111MODULE=on CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -installsuffix cgo -o async-gateway ./cmd/async-gateway FROM alpine:3.12 diff --git a/images/dequeuer/Dockerfile b/images/dequeuer/Dockerfile index 5c3e7c31f7..24671721cb 100644 --- a/images/dequeuer/Dockerfile +++ b/images/dequeuer/Dockerfile @@ -1,3 +1,5 @@ +ARG TARGETARCH, TARGETOS + # Build the manager binary FROM golang:1.15 as builder @@ -17,7 +19,7 @@ COPY pkg/workloads pkg/workloads COPY cmd/dequeuer cmd/dequeuer # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o dequeuer ./cmd/dequeuer +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -o dequeuer ./cmd/dequeuer # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/images/enqueuer/Dockerfile b/images/enqueuer/Dockerfile index 392d3d90fa..04de1f6952 100644 --- a/images/enqueuer/Dockerfile +++ b/images/enqueuer/Dockerfile @@ -1,3 +1,5 @@ +ARG TARGETARCH, TARGETOS + # Build the manager binary FROM golang:1.15 as builder @@ -16,7 +18,7 @@ COPY pkg/workloads pkg/workloads COPY cmd/enqueuer cmd/enqueuer # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o enqueuer ./cmd/enqueuer +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -o enqueuer ./cmd/enqueuer # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/images/kube-rbac-proxy/Dockerfile b/images/kube-rbac-proxy/Dockerfile index 1ffeaecb1d..e9d51ccd9d 100644 --- a/images/kube-rbac-proxy/Dockerfile +++ b/images/kube-rbac-proxy/Dockerfile @@ -1 +1,14 @@ -FROM quay.io/coreos/kube-rbac-proxy:v0.4.1 +# This file has been adapted from https://github.com/brancz/kube-rbac-proxy +ARG TARGETARCH, TARGETOS + +FROM golang:1.11 AS builder +RUN git clone -b v0.4.1 --depth 1 https://github.com/brancz/kube-rbac-proxy /go/src/github.com/brancz/kube-rbac-proxy +WORKDIR /go/src/github.com/brancz/kube-rbac-proxy +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build --installsuffix cgo -o kube-rbac-proxy github.com/brancz/kube-rbac-proxy \ + && cp kube-rbac-proxy /usr/local/bin + +FROM alpine:3.8 +RUN apk add -U --no-cache ca-certificates && rm -rf /var/cache/apk/* +COPY --from=builder /usr/local/bin/kube-rbac-proxy . +ENTRYPOINT ["./kube-rbac-proxy"] +EXPOSE 8080 diff --git a/images/kubexit/Dockerfile b/images/kubexit/Dockerfile index 9851d0d2fc..77987ca179 100644 --- a/images/kubexit/Dockerfile +++ b/images/kubexit/Dockerfile @@ -1,13 +1,13 @@ # This file has been adapted from https://github.com/cortexlabs/kubexit -FROM golang:1.14.1-alpine3.11 AS builder -RUN apk update && apk upgrade && \ - apk add bash git openssh +ARG TARGETARCH, TARGETOS + +FROM golang:1.14 AS builder RUN mkdir /tmp/kubexit RUN git clone -b v0.1.0-cortex --depth 1 https://github.com/cortexlabs/kubexit.git /tmp/kubexit WORKDIR /tmp/kubexit -RUN CGO_ENABLED=0 GOOS=linux go build -o kubexit ./cmd/kubexit +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o kubexit ./cmd/kubexit FROM alpine:3.11 RUN apk --no-cache add ca-certificates tzdata diff --git a/images/proxy/Dockerfile b/images/proxy/Dockerfile index 2573e4e64d..eb4e1a4534 100644 --- a/images/proxy/Dockerfile +++ b/images/proxy/Dockerfile @@ -1,3 +1,5 @@ +ARG TARGETARCH, TARGETOS + # Build the manager binary FROM golang:1.15 as builder @@ -15,7 +17,7 @@ COPY cmd/proxy cmd/proxy WORKDIR /workspace/cmd/proxy # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o /workspace/bin/proxy main.go +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o /workspace/bin/proxy main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/manager/generate_eks.py b/manager/generate_eks.py index c54c18a216..204c407818 100644 --- a/manager/generate_eks.py +++ b/manager/generate_eks.py @@ -13,13 +13,34 @@ # limitations under the License. import json -import sys import click +from collections import namedtuple +import re import yaml K8S_VERSION = "1.18" +ParsedInstanceType = namedtuple( + "ParsedInstanceType", ["family", "generation", "capabilities", "size"] +) + + +def parse_instance_type(instance_type: str) -> ParsedInstanceType: + parts = instance_type.split(".") + if len(parts) != 2: + raise ValueError(f"unexpected invalid instance type: {instance_type}") + + prefix = parts[0] + size = parts[1] + + family = re.search("[a-z]*", prefix.lower()).group() + generation = re.sub("\D", "", prefix.lower()) + capabilities = prefix[len(family) + len(generation) :] + + return ParsedInstanceType(family, generation, capabilities, size) + + # kubelet config schema: # https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/kubelet/config/v1beta1/types.go def default_nodegroup(cluster_config): @@ -132,7 +153,8 @@ def apply_gpu_settings(nodegroup): def is_gpu(instance_type): - return instance_type.startswith("g") or instance_type.startswith("p") + parsed_instance_type = parse_instance_type(instance_type) + return parsed_instance_type.family in ["g", "p"] def apply_inf_settings(nodegroup, config): @@ -155,7 +177,8 @@ def apply_inf_settings(nodegroup, config): def is_inf(instance_type): - return instance_type.startswith("inf") + parsed_instance_type = parse_instance_type(instance_type) + return parsed_instance_type.family == "inf" def get_inf_resources(instance_type): @@ -170,6 +193,11 @@ def get_inf_resources(instance_type): return num_chips, f"{128 * num_chips}Mi" +def is_arm64(instance_type: str): + parsed_instance_type = parse_instance_type(instance_type) + return parsed_instance_type.family == "a" or "g" in parsed_instance_type.capabilities + + def get_all_worker_nodegroups(ami_map: dict, cluster_config: dict) -> list: """ Gets all node groups in EKS-dict format. @@ -220,8 +248,10 @@ def get_empty_eks_nodegroup(name: str) -> dict: def get_ami(ami_map: dict, instance_type: str) -> str: if is_gpu(instance_type) or is_inf(instance_type): - return ami_map["accelerated"] - return ami_map["cpu"] + return ami_map["accelerated_amd64"] + if is_arm64(instance_type): + return ami_map["cpu_arm64"] + return ami_map["cpu_amd64"] @click.command() @@ -311,7 +341,11 @@ def generate_eks( "addons": [ { "name": "vpc-cni", - "version": "1.7.10", + "version": "1.8.0", + }, + { + "name": "kube-proxy", + "version": "1.18.8", }, ], } diff --git a/manager/install.sh b/manager/install.sh index d76de8a69d..69f42800d9 100755 --- a/manager/install.sh +++ b/manager/install.sh @@ -333,7 +333,7 @@ function add_nodegroups() { echo "○ adding new nodegroup(s) to the cluster ..." python generate_eks.py $CORTEX_CLUSTER_CONFIG_FILE manifests/ami.json --add-cortex-node-groups="$nodegroup_names" > /workspace/nodegroups.yaml - eksctl create nodegroup --timeout=$EKSCTL_NODEGROUP_TIMEOUT --install-neuron-plugin=false --install-nvidia-plugin=false -f /workspace/nodegroups.yaml + eksctl create nodegroup --timeout=$EKSCTL_NODEGROUP_TIMEOUT --install-neuron-plugin=false --install-nvidia-plugin=false --skip-outdated-addons-check -f /workspace/nodegroups.yaml rm /workspace/nodegroups.yaml echo } diff --git a/manager/manifests/ami.json b/manager/manifests/ami.json index aa3e2ffdfd..9c10c9de5f 100644 --- a/manager/manifests/ami.json +++ b/manager/manifests/ami.json @@ -1,96 +1,119 @@ { "1.18": { "af-south-1": { - "accelerated": "ami-09dbb6301ecd4c8ed", - "cpu": "ami-01fda598d7d31ca34" + "accelerated_amd64": "ami-09dbb6301ecd4c8ed", + "cpu_amd64": "ami-01fda598d7d31ca34", + "cpu_arm64": "ami-08556b4f3d2523237" }, "ap-east-1": { - "accelerated": "ami-092643f8396c00e6d", - "cpu": "ami-05baab8ab39f975cc" + "accelerated_amd64": "ami-092643f8396c00e6d", + "cpu_amd64": "ami-05baab8ab39f975cc", + "cpu_arm64": "ami-0d0efa0b348fc62be" }, "ap-northeast-1": { - "accelerated": "ami-07075c31664644d56", - "cpu": "ami-0d8366db514b71362" + "accelerated_amd64": "ami-07075c31664644d56", + "cpu_amd64": "ami-0d8366db514b71362", + "cpu_arm64": "ami-0b57af18f786a8723" }, "ap-northeast-2": { - "accelerated": "ami-0b0ccf6e451bc71c0", - "cpu": "ami-0f2595b147de819e6" + "accelerated_amd64": "ami-0b0ccf6e451bc71c0", + "cpu_amd64": "ami-0f2595b147de819e6", + "cpu_arm64": "ami-0e9c6c02a5a2b3108" }, "ap-northeast-3": { - "accelerated": "ami-0cc1736088413e3d3", - "cpu": "ami-07526d5726fefb0e3" + "accelerated_amd64": "ami-0cc1736088413e3d3", + "cpu_amd64": "ami-07526d5726fefb0e3", + "cpu_arm64": "ami-054c13b9aef254d3c" }, "ap-south-1": { - "accelerated": "ami-0c068f5bfde3d2537", - "cpu": "ami-018ad103064da8b95" + "accelerated_amd64": "ami-0c068f5bfde3d2537", + "cpu_amd64": "ami-018ad103064da8b95", + "cpu_arm64": "ami-086a8ff4ed7eec145" }, "ap-southeast-1": { - "accelerated": "ami-0fe1513e385d2398c", - "cpu": "ami-0df554c21406efafb" + "accelerated_amd64": "ami-0fe1513e385d2398c", + "cpu_amd64": "ami-0df554c21406efafb", + "cpu_arm64": "ami-0cfd1a3fd0befa360" }, "ap-southeast-2": { - "accelerated": "ami-0104bf0b5b2fef4af", - "cpu": "ami-04560040fa5006d03" + "accelerated_amd64": "ami-0104bf0b5b2fef4af", + "cpu_amd64": "ami-04560040fa5006d03", + "cpu_arm64": "ami-0407c312d26bb79bd" }, "ca-central-1": { - "accelerated": "ami-03da7af698418621b", - "cpu": "ami-047e794bde5d7210b" + "accelerated_amd64": "ami-03da7af698418621b", + "cpu_amd64": "ami-047e794bde5d7210b", + "cpu_arm64": "ami-0bd73de29f7b06de6" }, "eu-central-1": { - "accelerated": "ami-0d9666606ff989a98", - "cpu": "ami-04d9a86ec8fd40b1f" + "accelerated_amd64": "ami-0d9666606ff989a98", + "cpu_amd64": "ami-04d9a86ec8fd40b1f", + "cpu_arm64": "ami-06849dbd130ba315a" }, "eu-north-1": { - "accelerated": "ami-00dbfd663385ce54b", - "cpu": "ami-031ebcd37827da3ce" + "accelerated_amd64": "ami-00dbfd663385ce54b", + "cpu_amd64": "ami-031ebcd37827da3ce", + "cpu_arm64": "ami-07fed4d9d487f8ba8" }, "eu-south-1": { - "accelerated": "ami-0495fadf45bb9435e", - "cpu": "ami-0de202af1558dda27" + "accelerated_amd64": "ami-0495fadf45bb9435e", + "cpu_amd64": "ami-0de202af1558dda27", + "cpu_arm64": "ami-0c4b9dff31b0f4a2f" }, "eu-west-1": { - "accelerated": "ami-0288c9a9037e0d365", - "cpu": "ami-01ea01b6f3b80adfa" + "accelerated_amd64": "ami-0288c9a9037e0d365", + "cpu_amd64": "ami-01ea01b6f3b80adfa", + "cpu_arm64": "ami-07baa2ef15a15b140" }, "eu-west-2": { - "accelerated": "ami-046ace414ecb0894b", - "cpu": "ami-064d5de87f6381ad1" + "accelerated_amd64": "ami-046ace414ecb0894b", + "cpu_amd64": "ami-064d5de87f6381ad1", + "cpu_arm64": "ami-0f43b63ae39a176b5" }, "eu-west-3": { - "accelerated": "ami-0167e363b586e57c3", - "cpu": "ami-034f14ae8f5582c2b" + "accelerated_amd64": "ami-0167e363b586e57c3", + "cpu_amd64": "ami-034f14ae8f5582c2b", + "cpu_arm64": "ami-0f9f72a42176ecb78" }, "me-south-1": { - "accelerated": "ami-0adb2677502f6a201", - "cpu": "ami-0ee3de9dbfa430ba0" + "accelerated_amd64": "ami-0adb2677502f6a201", + "cpu_amd64": "ami-0ee3de9dbfa430ba0", + "cpu_arm64": "ami-0ac6cc848dc354d0e" }, "sa-east-1": { - "accelerated": "ami-00b89eb1afb4d1bc3", - "cpu": "ami-062970bb42bd2a893" + "accelerated_amd64": "ami-00b89eb1afb4d1bc3", + "cpu_amd64": "ami-062970bb42bd2a893", + "cpu_arm64": "ami-04011d161dcca2764" }, "us-east-1": { - "accelerated": "ami-0defcae078e1e5047", - "cpu": "ami-0c29dd87e87fb4dfd" + "accelerated_amd64": "ami-0defcae078e1e5047", + "cpu_amd64": "ami-0c29dd87e87fb4dfd", + "cpu_arm64": "ami-020da68433ccd915e" }, "us-east-2": { - "accelerated": "ami-0884b0ef7c1f7e7fc", - "cpu": "ami-0170c40fb8fc775fd" + "accelerated_amd64": "ami-0884b0ef7c1f7e7fc", + "cpu_amd64": "ami-0170c40fb8fc775fd", + "cpu_arm64": "ami-081909c0f3aaa7ff7" }, "us-gov-east-1": { - "accelerated": "ami-07653f09bdcedd6e9", - "cpu": "ami-02e81a5a67eb65e67" + "accelerated_amd64": "ami-07653f09bdcedd6e9", + "cpu_amd64": "ami-02e81a5a67eb65e67", + "cpu_arm64": "ami-06e2a5be334ca6bef" }, "us-gov-west-1": { - "accelerated": "ami-082b687837e601b3f", - "cpu": "ami-0531b9d822dfe1630" + "accelerated_amd64": "ami-082b687837e601b3f", + "cpu_amd64": "ami-0531b9d822dfe1630", + "cpu_arm64": "ami-0492cd68a612a51b8" }, "us-west-1": { - "accelerated": "ami-055013041042c12f5", - "cpu": "ami-00d244e1909bc2e94" + "accelerated_amd64": "ami-055013041042c12f5", + "cpu_amd64": "ami-00d244e1909bc2e94", + "cpu_arm64": "ami-0f3bf36928134da10" }, "us-west-2": { - "accelerated": "ami-042223ea760b6b965", - "cpu": "ami-035810617acd47976" + "accelerated_amd64": "ami-042223ea760b6b965", + "cpu_amd64": "ami-035810617acd47976", + "cpu_arm64": "ami-0b9104051172588d9" } } } diff --git a/pkg/lib/aws/ec2.go b/pkg/lib/aws/ec2.go index 8ae55b0cb8..338a719c91 100644 --- a/pkg/lib/aws/ec2.go +++ b/pkg/lib/aws/ec2.go @@ -137,6 +137,19 @@ func IsAMDGPUInstance(instanceType string) (bool, error) { return false, nil } +func IsMacInstance(instanceType string) (bool, error) { + parsedType, err := ParseInstanceType(instanceType) + if err != nil { + return false, err + } + + if parsedType.Family == "mac" { + return true, nil + } + + return false, nil +} + func (c *Client) SpotInstancePrice(instanceType string) (float64, error) { result, err := c.EC2().DescribeSpotPriceHistory(&ec2.DescribeSpotPriceHistoryInput{ InstanceTypes: []*string{aws.String(instanceType)}, diff --git a/pkg/types/clusterconfig/cluster_config.go b/pkg/types/clusterconfig/cluster_config.go index ad7667d403..3ce39253cc 100644 --- a/pkg/types/clusterconfig/cluster_config.go +++ b/pkg/types/clusterconfig/cluster_config.go @@ -1441,20 +1441,20 @@ func validateInstanceType(instanceType string) (string, error) { return "", ErrorInstanceTypeNotSupportedByCortex(instanceType) } - isARM, err := aws.IsARMInstance(instanceType) + isAMDGPU, err := aws.IsAMDGPUInstance(instanceType) if err != nil { return "", err } - if isARM { - return "", ErrorARMInstancesNotSupported(instanceType) + if isAMDGPU { + return "", ErrorAMDGPUInstancesNotSupported(instanceType) } - isAMDGPU, err := aws.IsAMDGPUInstance(instanceType) + isMac, err := aws.IsMacInstance(instanceType) if err != nil { return "", err } - if isAMDGPU { - return "", ErrorAMDGPUInstancesNotSupported(instanceType) + if isMac { + return "", ErrorMacInstancesNotSupported(instanceType) } if _, ok := awsutils.InstanceNetworkingLimits[instanceType]; !ok { diff --git a/pkg/types/clusterconfig/errors.go b/pkg/types/clusterconfig/errors.go index ca130e99fe..b5126d94bc 100644 --- a/pkg/types/clusterconfig/errors.go +++ b/pkg/types/clusterconfig/errors.go @@ -45,8 +45,8 @@ const ( ErrSpotPriceGreaterThanTargetOnDemand = "clusterconfig.spot_price_greater_than_target_on_demand" ErrSpotPriceGreaterThanMaxPrice = "clusterconfig.spot_price_greater_than_max_price" ErrInstanceTypeNotSupportedByCortex = "clusterconfig.instance_type_not_supported_by_cortex" - ErrARMInstancesNotSupported = "clusterconfig.arm_instances_not_supported" ErrAMDGPUInstancesNotSupported = "clusterconfig.amd_gpu_instances_not_supported" + ErrMacInstancesNotSupported = "clusterconfig.mac_instances_not_supported" ErrAtLeastOneInstanceDistribution = "clusterconfig.at_least_one_instance_distribution" ErrNoCompatibleSpotInstanceFound = "clusterconfig.no_compatible_spot_instance_found" ErrConfiguredWhenSpotIsNotEnabled = "clusterconfig.configured_when_spot_is_not_enabled" @@ -195,17 +195,17 @@ func ErrorInstanceTypeNotSupportedByCortex(instanceType string) error { }) } -func ErrorARMInstancesNotSupported(instanceType string) error { +func ErrorAMDGPUInstancesNotSupported(instanceType string) error { return errors.WithStack(&errors.Error{ - Kind: ErrARMInstancesNotSupported, - Message: fmt.Sprintf("ARM-based instances (including %s) are not supported by cortex", instanceType), + Kind: ErrAMDGPUInstancesNotSupported, + Message: fmt.Sprintf("AMD GPU instances (including %s) are not supported by cortex", instanceType), }) } -func ErrorAMDGPUInstancesNotSupported(instanceType string) error { +func ErrorMacInstancesNotSupported(instanceType string) error { return errors.WithStack(&errors.Error{ - Kind: ErrAMDGPUInstancesNotSupported, - Message: fmt.Sprintf("AMD GPU instances (including %s) are not supported by cortex", instanceType), + Kind: ErrMacInstancesNotSupported, + Message: fmt.Sprintf("mac instances (including %s) are not supported by cortex", instanceType), }) } diff --git a/test/apis/realtime/hello-world/cortex_cpu_arm64.yaml b/test/apis/realtime/hello-world/cortex_cpu_arm64.yaml new file mode 100644 index 0000000000..2aba4c6c0b --- /dev/null +++ b/test/apis/realtime/hello-world/cortex_cpu_arm64.yaml @@ -0,0 +1,16 @@ +- name: hello-world + kind: RealtimeAPI + pod: + port: 8080 + max_concurrency: 1 + containers: + - name: api + image: infrastructureascode/hello-world + readiness_probe: + http_get: + path: "/health" + port: 8080 + compute: + cpu: 200m + mem: 128Mi + node_groups: ["arm"] diff --git a/test/apis/realtime/hello-world/sample.json b/test/apis/realtime/hello-world/sample.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/test/apis/realtime/hello-world/sample.json @@ -0,0 +1 @@ +{} diff --git a/test/e2e/e2e/tests.py b/test/e2e/e2e/tests.py index 0092960f6a..4e7159f3ce 100644 --- a/test/e2e/e2e/tests.py +++ b/test/e2e/e2e/tests.py @@ -40,7 +40,8 @@ wait_on_event, wait_on_futures, endpoint_ready, - request_prediction, + post_request, + get_request, job_done, jobs_done, request_batch_prediction, @@ -68,6 +69,7 @@ def test_realtime_api( timeout: int = None, api_config_name: str = "cortex_cpu.yaml", extra_path: str = "", + method: str = "POST", ): api_dir = TEST_APIS_DIR / api with open(str(api_dir / api_config_name)) as f: @@ -89,7 +91,10 @@ def test_realtime_api( with open(str(api_dir / "sample.json")) as f: payload = json.load(f) - response = request_prediction(client, api_name, payload, extra_path) + if method == "POST": + response = post_request(client, api_name, payload, extra_path) + else: + response = get_request(client, api_name, payload, extra_path) assert ( response.status_code == HTTPStatus.OK @@ -227,7 +232,7 @@ def test_async_api( with open(str(api_dir / "sample.json")) as f: payload = json.load(f) - response = request_prediction(client, api_name, payload) + response = post_request(client, api_name, payload) assert ( response.status_code == HTTPStatus.OK @@ -854,7 +859,7 @@ def test_long_running_realtime( counter = 0 start_time = time.time() while time.time() - start_time <= time_to_run: - response = request_prediction(client, api_name, payload) + response = post_request(client, api_name, payload) assert ( response.status_code == HTTPStatus.OK diff --git a/test/e2e/e2e/utils.py b/test/e2e/e2e/utils.py index c15e2e0a77..52020a037c 100644 --- a/test/e2e/e2e/utils.py +++ b/test/e2e/e2e/utils.py @@ -126,7 +126,7 @@ def _runnable(job_id): return True -def request_prediction( +def post_request( client: cx.Client, api_name: str, payload: Union[List, Dict], @@ -141,6 +141,21 @@ def request_prediction( return response +def get_request( + client: cx.Client, + api_name: str, + payload: Union[List, Dict], + extra_path: Optional[str] = None, +) -> requests.Response: + api_info = client.get_api(api_name) + endpoint = api_info["endpoint"] + if extra_path and extra_path != "": + endpoint = os.path.join(endpoint, extra_path) + response = requests.get(endpoint, json=payload) + + return response + + def retrieve_async_result(client: cx.Client, api_name: str, request_id: str) -> requests.Response: api_info = client.get_api(api_name) response = requests.get(f"{api_info['endpoint']}/{request_id}") diff --git a/test/e2e/tests/aws/test_realtime.py b/test/e2e/tests/aws/test_realtime.py index 71c4b2fd13..738f69869e 100644 --- a/test/e2e/tests/aws/test_realtime.py +++ b/test/e2e/tests/aws/test_realtime.py @@ -32,6 +32,12 @@ "extra_path": "", }, ] +TEST_APIS_ARM = [ + { + "name": "realtime/hello-world", + "extra_path": "", + }, +] TEST_APIS_GPU = [ { "name": "realtime/image-classifier-resnet50", @@ -58,6 +64,22 @@ def test_realtime_api(printer: Callable, config: Dict, client: cx.Client, api: D ) +@pytest.mark.usefixtures("client") +@pytest.mark.parametrize("api", TEST_APIS_ARM) +def test_realtime_api_arm(printer: Callable, config: Dict, client: cx.Client, api: Dict[str, str]): + + printer(f"testing {api['name']}") + e2e.tests.test_realtime_api( + printer=printer, + client=client, + api=api["name"], + timeout=config["global"]["realtime_deploy_timeout"], + api_config_name="cortex_cpu_arm64.yaml", + extra_path=api["extra_path"], + method="GET", + ) + + @pytest.mark.usefixtures("client") @pytest.mark.parametrize("api", TEST_APIS_GPU) def test_realtime_api_gpu(printer: Callable, config: Dict, client: cx.Client, api: Dict[str, str]):