Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/integration-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Clean up disk space
run: |
echo "--- Disk space before cleanup ---"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/share/code
sudo rm -rf /usr/share/miniconda
sudo rm -rf /usr/share/az_deps
# Remove unused Docker images, containers, networks, and build cache
# The '|| true' prevents the workflow from failing if no items are found to prune.
docker system prune -a --force || true
docker builder prune -a --force || true

echo "--- Disk space after cleanup ---"
df -h

# Retrieve build locations with `go env`
# <https://markphelps.me/posts/speed-up-your-go-builds-with-actions-cache/>
- id: go-cache-paths
Expand Down
16 changes: 11 additions & 5 deletions integration/examples/gcb-kaniko/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
FROM golang:1.18 as builder
# Stage 1
FROM debian:stable-slim AS builder
COPY --from=golang:1.18 /usr/local/go /usr/local/go
ENV PATH="/usr/local/go/bin:${PATH}"

WORKDIR /code
COPY main.go .
COPY go.mod .

# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations
ARG SKAFFOLD_GO_GCFLAGS
RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -trimpath -o /app main.go

FROM alpine:3
# Define GOTRACEBACK to mark this container as using the Go language runtime
# for `skaffold debug` (https://skaffold.dev/docs/workflows/debug/).
# Stage 2
FROM debian:stable-slim
ENV GOTRACEBACK=single
CMD ["./app"]

WORKDIR /
COPY --from=builder /app .
CMD ["./app"]
16 changes: 11 additions & 5 deletions integration/examples/kaniko/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
FROM golang:1.18 as builder
# Stage 1
FROM debian:stable-slim AS builder
COPY --from=golang:1.18 /usr/local/go /usr/local/go
ENV PATH="/usr/local/go/bin:${PATH}"

WORKDIR /code
COPY main.go .
COPY go.mod .

# `skaffold debug` sets SKAFFOLD_GO_GCFLAGS to disable compiler optimizations
ARG SKAFFOLD_GO_GCFLAGS
RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -trimpath -o /app main.go

FROM alpine:3
# Define GOTRACEBACK to mark this container as using the Go language runtime
# for `skaffold debug` (https://skaffold.dev/docs/workflows/debug/).
# Stage 2
FROM debian:stable-slim
ENV GOTRACEBACK=single
CMD ["./app"]

WORKDIR /
COPY --from=builder /app .
CMD ["./app"]
1 change: 1 addition & 0 deletions integration/examples/kaniko/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build:
cache: {}
cluster:
pullSecretName: e2esecret
timeout: 120m
manifests:
rawYaml:
- k8s-*
2 changes: 2 additions & 0 deletions integration/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ func TestRunGCPOnly(t *testing.T) {
ns, client := SetupNamespace(t)

test.args = append(test.args, "--tag", uuid.New().String())
// --build-concurrency=1 prevents the disk I/O bottleneck
test.args = append(test.args, "--tag", uuid.New().String(), "--build-concurrency=1")

skaffold.Run(test.args...).InDir(test.dir).InNs(ns.Name).RunOrFail(t)

Expand Down
Loading