diff --git a/.travis.yml b/.travis.yml index d7f65f11..cf2c2fe3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ sudo: false dist: focal -arch: [amd64, arm64] +arch: [arm64] #[amd64,arm64] language: go go: "1.15.x" @@ -9,54 +9,40 @@ addons: apt: packages: [jq] -env: - - DOCKER_BUILDKIT=0 - before_install: # ensure we're using recent docker with containerd >= 1.3.4 so as to be able to use gcr mirror #- sh hack/update-docker.sh # enable buildkit plus configure gcr mirror #- sh hack/enable-docker-buildkit.sh - - sh hack/use-gcr-mirror.sh - - sudo service docker restart || (systemctl status docker.service; journalctl -xe) + #- sh hack/use-gcr-mirror.sh + #- sudo service docker restart || (systemctl status docker.service; journalctl -xe) - docker info # Remove buildkit'isms from Dockerfiles - - sh hack/strip-buildkitisms.sh + #- sh hack/strip-buildkitisms.sh install: - mkdir -p $HOME/bin - curl -Lo $HOME/bin/skaffold https://storage.googleapis.com/skaffold/builds/latest/skaffold-linux-${TRAVIS_CPU_ARCH} - curl -Lo $HOME/bin/container-structure-test https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-${TRAVIS_CPU_ARCH} - - curl -Lo $HOME/bin/kind https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-linux-${TRAVIS_CPU_ARCH} + #- curl -Lo $HOME/bin/kind https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-linux-${TRAVIS_CPU_ARCH} + - curl -Lo $HOME/bin/minikube https://storage.googleapis.com/minikube-builds/master/minikube-linux-${TRAVIS_CPU_ARCH} + - curl -Lo $HOME/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/${TRAVIS_CPU_ARCH}/kubectl - chmod +x $HOME/bin/* - export PATH=$HOME/bin:$PATH - skaffold config set --global collect-metrics false script: + - minikube start || travis_terminate $? + - (cd nodejs/helper-image; go test .) - (cd python/helper-image/launcher; go test .) # try building before integration tests - skaffold build -p local -v info -p integration || travis_terminate $? - # Create a kind configuration to use the docker daemon's configured - # registry-mirrors. - - | - docker system info --format '{{printf "apiVersion: kind.x-k8s.io/v1alpha4\nkind: Cluster\ncontainerdConfigPatches:\n"}}{{range $reg, $config := .RegistryConfig.IndexConfigs}}{{if $config.Mirrors}}{{printf "- |-\n [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"%s\"]\n endpoint = [" $reg}}{{range $index, $mirror := $config.Mirrors}}{{if $index}},{{end}}{{printf "%q" $mirror}}{{end}}{{printf "]\n"}}{{end}}{{end}}' | tee /tmp/kind.config - - # `kind create cluster` is very verbose - - (kind create cluster --retain -v 1 --config /tmp/kind.config && kind get kubeconfig > /tmp/kube.config) - || (kind export logs; - docker ps -a --format '{{.Image}} {{.ID}} {{.Names}}' | - while read image cid name; do - echo "=== $image ($cid) $name ==="; - docker logs $cid | sed 's/^/> /'; - done; - travis_terminate $?) - # we had `run-its.sh` in `after_success` but it doesn't cause failures - - KUBECONFIG=/tmp/kube.config bash ./run-its.sh -p local + - bash ./run-its.sh -p local diff --git a/README.md b/README.md index 9e0f8f6c..93e29777 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,11 @@ form produced by `skaffold debug`. To run: ```sh sh run-its.sh ``` + +# Troubleshooting + +## Development + +We use buildx to avoid 'failed to load cache key' and +'failed size validation' errors + diff --git a/go/helper-image/Dockerfile b/go/helper-image/Dockerfile index e568cd2e..3d1b7010 100644 --- a/go/helper-image/Dockerfile +++ b/go/helper-image/Dockerfile @@ -1,8 +1,8 @@ ARG GOVERSION=1.16 -FROM --platform=$BUILDPLATFORM golang:${GOVERSION} as delve -ARG BUILDPLATFORM -ARG TARGETOS -ARG TARGETARCH +FROM golang:${GOVERSION} as delve +ARG BUILDPLATFORM=linux/arm64 +ARG TARGETOS=linux +ARG TARGETARCH=arm64 ARG DELVE_VERSION=1.6.0 diff --git a/go/test/goapp/Dockerfile b/go/test/goapp/Dockerfile index de2fc99b..9ac0618c 100644 --- a/go/test/goapp/Dockerfile +++ b/go/test/goapp/Dockerfile @@ -1,13 +1,13 @@ ARG GOVERSION -FROM --platform=$BUILDPLATFORM golang:$GOVERSION as builder -ARG BUILDPLATFORM -ARG TARGETOS -ARG TARGETARCH +FROM golang:$GOVERSION as builder +ARG BUILDPLATFORM=linux/arm64 +ARG TARGETOS=linux +ARG TARGETARCH=arm64 COPY main.go . RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -gcflags="all=-N -l" -o /app main.go -FROM --platform=$BUILDPLATFORM gcr.io/distroless/base +FROM gcr.io/distroless/base CMD ["./app"] ENV GOTRACEBACK=single COPY --from=builder /app . diff --git a/integration/kubectl/Dockerfile b/integration/kubectl/Dockerfile index 9aae3f63..fd8b4c3a 100644 --- a/integration/kubectl/Dockerfile +++ b/integration/kubectl/Dockerfile @@ -1,8 +1,8 @@ # Simple multi-platform image that includes kubectl and curl -FROM --platform=$BUILDPLATFORM curlimages/curl -ARG BUILDPLATFORM -ARG TARGETOS -ARG TARGETARCH +FROM curlimages/curl +ARG BUILDPLATFORM=linux/arm64 +ARG TARGETOS=linux +ARG TARGETARCH=arm64 # curlimages/curl runs as curl-user and cannot install into /usr/bin USER root diff --git a/netcore/helper-image/Dockerfile b/netcore/helper-image/Dockerfile index 2743e5ea..9ad15feb 100644 --- a/netcore/helper-image/Dockerfile +++ b/netcore/helper-image/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get update \ # Now populate the duct-tape image with the language runtime debugging support files # The debian image is about 95MB bigger FROM busybox -ARG BUILDPLATFORM +ARG BUILDPLATFORM=linux/arm64 # The install script copies all files in /duct-tape to /dbg COPY install.sh / diff --git a/nodejs/helper-image/Dockerfile b/nodejs/helper-image/Dockerfile index 5704a912..7ffb033a 100644 --- a/nodejs/helper-image/Dockerfile +++ b/nodejs/helper-image/Dockerfile @@ -1,8 +1,8 @@ ARG GOVERSION=1.16 -FROM --platform=$BUILDPLATFORM golang:${GOVERSION} as build -ARG BUILDPLATFORM -ARG TARGETOS -ARG TARGETARCH +FROM golang:${GOVERSION} as build +ARG BUILDPLATFORM=linux/arm64 +ARG TARGETOS=linux +ARG TARGETARCH=arm64 COPY . . # Produce an as-static-as-possible dlv binary to work on musl and glibc diff --git a/python/helper-image/Dockerfile b/python/helper-image/Dockerfile index 39c5d11e..0b386faf 100644 --- a/python/helper-image/Dockerfile +++ b/python/helper-image/Dockerfile @@ -77,7 +77,7 @@ RUN GOPATH="" CGO_ENABLED=0 go build -o launcher -ldflags '-s -w -extldflags "-s # Now populate the duct-tape image with the language runtime debugging support files # The debian image is about 95MB bigger FROM busybox -ARG BUILDPLATFORM +ARG BUILDPLATFORM=linux/arm64 # The install script copies all files in /duct-tape to /dbg COPY install.sh /