Skip to content

Commit a8e712e

Browse files
hamir-suspectdexykskipi
authored
ci: migrate semaphore YAMLs to use Ubuntu 24.04 (#267)
* Migrate to ubuntu2404 * chore: upgrade gemfiles * chore: upgrade golang and rename api module * toil(ci): adjust execution time limit, remove fail fast strategy * chore: migrate from docker-compose to docker compose command * chore: upgrade packages in self-hosted Dockerfile and add missing test dependencies --------- Co-authored-by: Dejan K <sidejan@gmail.com> Co-authored-by: Mikołaj Kutryj <mikolaj.kutryj@gmail.com>
1 parent 9936534 commit a8e712e

27 files changed

Lines changed: 65 additions & 54 deletions

.semaphore/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ version: "v1.0"
22
name: Release
33
agent:
44
machine:
5-
type: e1-standard-4
6-
os_image: ubuntu2004
5+
type: f1-standard-2
6+
os_image: ubuntu2404
77
blocks:
88
- name: "Release"
99
task:

.semaphore/semaphore.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ version: v1.0
22
name: Agent
33
agent:
44
machine:
5-
type: e1-standard-2
6-
os_image: ubuntu2004
5+
type: f1-standard-2
6+
os_image: ubuntu2404
77

88
execution_time_limit:
9-
minutes: 15
10-
11-
fail_fast:
12-
stop:
13-
when: true
9+
minutes: 10
1410

1511
blocks:
1612
- name: "Lint"
@@ -22,7 +18,7 @@ blocks:
2218

2319
prologue:
2420
commands:
25-
- sem-version go 1.23.8
21+
- sem-version go 1.24.11
2622
- checkout
2723

2824
jobs:
@@ -41,7 +37,7 @@ blocks:
4137
- checkout
4238
- mv ~/.ssh/security-toolbox ~/.ssh/id_rsa
4339
- sudo chmod 600 ~/.ssh/id_rsa
44-
- sem-version go 1.23.8
40+
- sem-version go 1.24.11
4541
jobs:
4642
- name: Check dependencies
4743
commands:
@@ -67,7 +63,7 @@ blocks:
6763

6864
prologue:
6965
commands:
70-
- sem-version go 1.23.8
66+
- sem-version go 1.24.11
7167
- checkout
7268
- go version
7369
- go get
@@ -100,7 +96,7 @@ blocks:
10096

10197
prologue:
10298
commands:
103-
- sem-version go 1.23.8
99+
- sem-version go 1.24.11
104100
- checkout
105101
- go version
106102
- go get
@@ -167,7 +163,7 @@ blocks:
167163

168164
prologue:
169165
commands:
170-
- sem-version go 1.23.8
166+
- sem-version go 1.24.11
171167
- checkout
172168
- go version
173169
- go get
@@ -204,7 +200,7 @@ blocks:
204200

205201
prologue:
206202
commands:
207-
- sem-version go 1.23.8
203+
- sem-version go 1.24.11
208204
- checkout
209205
- go version
210206
- go get
@@ -245,7 +241,7 @@ blocks:
245241

246242
prologue:
247243
commands:
248-
- sem-version go 1.23.8
244+
- sem-version go 1.24.11
249245
- curl -sLO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && install minikube-linux-amd64 /tmp/
250246
- /tmp/minikube-linux-amd64 config set WantUpdateNotification false
251247
- /tmp/minikube-linux-amd64 start --driver=docker

Dockerfile.self_hosted

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ARG USER_GID=$USER_UID
88
RUN groupadd --gid $USER_GID $USERNAME && \
99
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
1010

11-
RUN apt-get update -y && apt-get install -y --no-install-recommends ca-certificates curl
11+
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates curl
1212
RUN update-ca-certificates
1313

1414
# kubectl is required to be present in the container running the agent

Dockerfile.test

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ RUN apt-get update && \
44
apt-get install curl -y && \
55
curl -sSL https://get.docker.com/ | sh && \
66
apt-get install -y ssh docker-compose-plugin && \
7+
# Install standalone docker-compose for backward compatibility
8+
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
9+
chmod +x /usr/local/bin/docker-compose && \
710
# pin pyyaml to 5.3.1 until https://github.com/yaml/pyyaml/issues/724 is fixed
811
pip install pyyaml==5.3.1 && \
912
pip install awscli
@@ -29,4 +32,4 @@ ADD build/agent /app/agent
2932

3033
WORKDIR /app
3134

32-
CMD service ssh restart && ./agent serve --port 30000
35+
CMD ["sh", "-c", "service ssh restart && ./agent serve --port 30000"]

pkg/api/job_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package api
1+
package agentapi
22

33
import (
44
"encoding/base64"

pkg/api/job_request_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package api
1+
package agentapi
22

33
import (
44
"encoding/base64"

pkg/aws/aws.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"strings"
77

88
versions "github.com/hashicorp/go-version"
9-
"github.com/semaphoreci/agent/pkg/api"
9+
api "github.com/semaphoreci/agent/pkg/api"
1010
log "github.com/sirupsen/logrus"
1111
)
1212

pkg/docker/docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"regexp"
88
"strings"
99

10-
"github.com/semaphoreci/agent/pkg/api"
10+
api "github.com/semaphoreci/agent/pkg/api"
1111
"github.com/semaphoreci/agent/pkg/aws"
1212
)
1313

pkg/docker/docker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"runtime"
66
"testing"
77

8-
"github.com/semaphoreci/agent/pkg/api"
8+
api "github.com/semaphoreci/agent/pkg/api"
99
"github.com/stretchr/testify/assert"
1010
)
1111

pkg/eventlogger/default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"path/filepath"
88
"time"
99

10-
"github.com/semaphoreci/agent/pkg/api"
10+
api "github.com/semaphoreci/agent/pkg/api"
1111
)
1212

1313
const LoggerMethodPull = "pull"

0 commit comments

Comments
 (0)