Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version updates #125

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with: {submodules: true}
- run: scripts/test

build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with: {submodules: true}
- run: scripts/build
- run: scripts/build-image
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: image
path: image
Expand All @@ -26,9 +26,11 @@ jobs:
needs: [build-image]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v1
with: {name: image}
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: image
path: image
- uses: docker://concourse/registry-image-resource
with: {entrypoint: scripts/push-image}
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with: {submodules: true}
- run: scripts/test

build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with: {submodules: true}
- run: scripts/build
- run: scripts/build-image
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# syntax = docker/dockerfile:experimental
# syntax = docker/dockerfile:1.11

FROM concourse/golang-builder AS builder
WORKDIR /src
COPY go.mod /src/go.mod
COPY go.sum /src/go.sum
RUN --mount=type=cache,target=/root/.cache/go-build go get -d ./...
COPY . /src
ENV CGO_ENABLED 0
ENV CGO_ENABLED=0
RUN go build -o /assets/task ./cmd/task
RUN go build -o /assets/build ./cmd/build

FROM moby/buildkit:v0.11.0 AS task
FROM moby/buildkit:v0.17.2 AS task
COPY --from=builder /assets/task /usr/bin/
COPY --from=builder /assets/build /usr/bin/
COPY bin/setup-cgroups /usr/bin/
Expand Down
6 changes: 2 additions & 4 deletions buildkitd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package task
import (
"fmt"
"io"
"io/ioutil"
"net/url"
"os"
"os/exec"
Expand Down Expand Up @@ -101,7 +100,7 @@ func SpawnBuildkitd(req Request, opts *BuildkitdOpts) (*Buildkitd, error) {
}

for {
err := buildctl(addr, ioutil.Discard, "debug", "workers")
err := buildctl(addr, io.Discard, "debug", "workers")
if err == nil {
break
}
Expand Down Expand Up @@ -149,8 +148,7 @@ func generateConfig(req Request, configPath string) error {
var config BuildkitdConfig

if len(req.Config.RegistryMirrors) > 0 {
var registryConfigs map[string]RegistryConfig
registryConfigs = make(map[string]RegistryConfig)
var registryConfigs = make(map[string]RegistryConfig)
registryConfigs["docker.io"] = RegistryConfig{
Mirrors: req.Config.RegistryMirrors,
}
Expand Down
7 changes: 3 additions & 4 deletions buildkitd_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package task_test

import (
"io/ioutil"
"os"
"path/filepath"
"testing"
Expand Down Expand Up @@ -30,7 +29,7 @@ func (s *BuildkitdSuite) TearDownSuite() {

func (s *BuildkitdSuite) SetupTest() {
var err error
s.outputsDir, err = ioutil.TempDir("", "oci-build-task-test")
s.outputsDir, err = os.MkdirTemp("", "oci-build-task-test")
s.NoError(err)

s.req = task.Request{
Expand Down Expand Up @@ -64,10 +63,10 @@ func (s *BuildkitdSuite) TestGenerateConfig() {
})
s.NoError(err)

configContent, err := ioutil.ReadFile(s.configPath("mirrors.toml"))
configContent, err := os.ReadFile(s.configPath("mirrors.toml"))
s.NoError(err)

expectedContent, err := ioutil.ReadFile("testdata/buildkitd-config/mirrors.toml")
expectedContent, err := os.ReadFile("testdata/buildkitd-config/mirrors.toml")
s.NoError(err)

s.Equal(expectedContent, configContent)
Expand Down
39 changes: 31 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
module github.com/concourse/oci-build-task

go 1.12
go 1.23

require (
github.com/BurntSushi/toml v0.4.1
github.com/VividCortex/ewma v1.1.1 // indirect
github.com/BurntSushi/toml v1.4.0
github.com/concourse/go-archive v1.0.1
github.com/fatih/color v1.13.0
github.com/google/go-containerregistry v0.9.0
github.com/fatih/color v1.18.0
github.com/google/go-containerregistry v0.20.2
github.com/julienschmidt/httprouter v1.3.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/u-root/u-root v7.0.0+incompatible
github.com/vbauerster/mpb v3.4.0+incompatible
github.com/vrischmann/envconfig v1.3.0
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
)

require (
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/cli v27.2.1+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.27.8 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/vbatts/tar-split v0.11.6 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading