Skip to content

Commit 4cb7a6c

Browse files
authored
ci: use runners provided by CNCF (#1946)
Signed-off-by: Ramkumar Chinchani <[email protected]>
1 parent 7ab2032 commit 4cb7a6c

File tree

5 files changed

+46
-26
lines changed

5 files changed

+46
-26
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
permissions:
1919
contents: write
2020
packages: write
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-latest-16-cores
2222
strategy:
2323
matrix:
2424
os: [linux, darwin, freebsd]

.github/workflows/nightly.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions: read-all
1414
jobs:
1515
dedupe:
1616
name: Dedupe/restore blobs
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-latest-16-cores
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: ./.github/actions/clean-runner
@@ -62,7 +62,7 @@ jobs:
6262

6363
sync:
6464
name: Sync harness
65-
runs-on: ubuntu-latest
65+
runs-on: ubuntu-latest-16-cores
6666
steps:
6767
- name: Check out source code
6868
uses: actions/checkout@v4
@@ -81,7 +81,7 @@ jobs:
8181
8282
gc-referrers-stress-s3:
8383
name: GC(with referrers) on S3(localstack) with short interval
84-
runs-on: ubuntu-latest
84+
runs-on: ubuntu-latest-16-cores
8585
steps:
8686
- uses: actions/checkout@v4
8787
- uses: ./.github/actions/clean-runner
@@ -118,7 +118,7 @@ jobs:
118118

119119
gc-stress-s3:
120120
name: GC(without referrers) on S3(localstack) with short interval
121-
runs-on: ubuntu-latest
121+
runs-on: ubuntu-latest-16-cores
122122
steps:
123123
- uses: actions/checkout@v4
124124
- uses: ./.github/actions/clean-runner
@@ -155,7 +155,7 @@ jobs:
155155

156156
docker-image:
157157
name: Build docker image (for users still using Docker environments)
158-
runs-on: ubuntu-latest
158+
runs-on: ubuntu-latest-16-cores
159159
steps:
160160
- uses: actions/checkout@v4
161161
- uses: ./.github/actions/clean-runner

.github/workflows/test.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions: read-all
1414
jobs:
1515
test-run-minimal:
1616
name: Running zot without extensions tests
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-latest-16-cores
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: ./.github/actions/clean-runner
@@ -57,7 +57,7 @@ jobs:
5757
- uses: ./.github/actions/teardown-localstack
5858
test-run-extensions:
5959
name: Run zot with extensions tests
60-
runs-on: ubuntu-latest
60+
runs-on: ubuntu-latest-16-cores
6161
steps:
6262
- uses: actions/checkout@v4
6363
- uses: ./.github/actions/clean-runner
@@ -80,7 +80,6 @@ jobs:
8080
cd $GITHUB_WORKSPACE
8181
go mod download
8282
- uses: ./.github/actions/setup-localstack
83-
- uses: ./.github/actions/check-diskspace
8483
- name: run zot extended tests
8584
run: |
8685
cd $GITHUB_WORKSPACE
@@ -99,7 +98,7 @@ jobs:
9998
- uses: ./.github/actions/teardown-localstack
10099
test-run-devmode:
101100
name: Running privileged tests on Linux
102-
runs-on: ubuntu-latest
101+
runs-on: ubuntu-latest-16-cores
103102
steps:
104103
- uses: actions/checkout@v4
105104
- uses: ./.github/actions/clean-runner

pkg/meta/dynamodb/dynamodb.go

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,8 +1451,11 @@ func (dwr *DynamoDB) createRepoMetaTable() error {
14511451
},
14521452
BillingMode: types.BillingModePayPerRequest,
14531453
})
1454+
if err != nil {
1455+
if strings.Contains(err.Error(), "Table already exists") {
1456+
return nil
1457+
}
14541458

1455-
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
14561459
return err
14571460
}
14581461

@@ -1517,8 +1520,11 @@ func (dwr *DynamoDB) createManifestDataTable() error {
15171520
},
15181521
BillingMode: types.BillingModePayPerRequest,
15191522
})
1523+
if err != nil {
1524+
if strings.Contains(err.Error(), "Table already exists") {
1525+
return nil
1526+
}
15201527

1521-
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
15221528
return err
15231529
}
15241530

@@ -1542,9 +1548,12 @@ func (dwr *DynamoDB) createIndexDataTable() error {
15421548
},
15431549
BillingMode: types.BillingModePayPerRequest,
15441550
})
1551+
if err != nil {
1552+
if strings.Contains(err.Error(), "Table already exists") {
1553+
return nil
1554+
}
15451555

1546-
if err != nil && strings.Contains(err.Error(), "Table already exists") {
1547-
return nil
1556+
return err
15481557
}
15491558

15501559
return dwr.waitTableToBeCreated(dwr.IndexDataTablename)
@@ -1837,8 +1846,11 @@ func (dwr *DynamoDB) createUserDataTable() error {
18371846
},
18381847
BillingMode: types.BillingModePayPerRequest,
18391848
})
1849+
if err != nil {
1850+
if strings.Contains(err.Error(), "Table already exists") {
1851+
return nil
1852+
}
18401853

1841-
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
18421854
return err
18431855
}
18441856

@@ -1862,8 +1874,11 @@ func (dwr DynamoDB) createAPIKeyTable() error {
18621874
},
18631875
BillingMode: types.BillingModePayPerRequest,
18641876
})
1877+
if err != nil {
1878+
if strings.Contains(err.Error(), "Table already exists") {
1879+
return nil
1880+
}
18651881

1866-
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
18671882
return err
18681883
}
18691884

pkg/meta/version/version_test.go

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
1212
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
1313
"github.com/aws/aws-sdk-go/aws"
14+
guuid "github.com/gofrs/uuid"
1415
. "github.com/smartystreets/goconvey/convey"
1516
"go.etcd.io/bbolt"
1617

@@ -116,16 +117,21 @@ func setBoltDBVersion(db *bbolt.DB, vers string) error {
116117
func TestVersioningDynamoDB(t *testing.T) {
117118
tskip.SkipDynamo(t)
118119

120+
uuid, err := guuid.NewV4()
121+
if err != nil {
122+
panic(err)
123+
}
124+
119125
Convey("Tests", t, func() {
120126
params := mdynamodb.DBDriverParameters{
121127
Endpoint: os.Getenv("DYNAMODBMOCK_ENDPOINT"),
122128
Region: "us-east-2",
123-
RepoMetaTablename: "RepoMetadataTable",
124-
ManifestDataTablename: "ManifestDataTable",
125-
IndexDataTablename: "IndexDataTable",
126-
UserDataTablename: "UserDataTable",
127-
APIKeyTablename: "ApiKeyTable",
128-
VersionTablename: "Version",
129+
RepoMetaTablename: "RepoMetadataTable" + uuid.String(),
130+
ManifestDataTablename: "ManifestDataTable" + uuid.String(),
131+
IndexDataTablename: "IndexDataTable" + uuid.String(),
132+
UserDataTablename: "UserDataTable" + uuid.String(),
133+
APIKeyTablename: "ApiKeyTable" + uuid.String(),
134+
VersionTablename: "Version" + uuid.String(),
129135
}
130136

131137
dynamoClient, err := mdynamodb.GetDynamoClient(params)
@@ -140,7 +146,7 @@ func TestVersioningDynamoDB(t *testing.T) {
140146
So(dynamoWrapper.ResetRepoMetaTable(), ShouldBeNil)
141147

142148
Convey("dbVersion is empty", func() {
143-
err := setDynamoDBVersion(dynamoWrapper.Client, "")
149+
err := setDynamoDBVersion(dynamoWrapper.Client, params.VersionTablename, "")
144150
So(err, ShouldBeNil)
145151

146152
err = dynamoWrapper.PatchDB()
@@ -160,7 +166,7 @@ func TestVersioningDynamoDB(t *testing.T) {
160166
},
161167
}
162168

163-
err := setDynamoDBVersion(dynamoWrapper.Client, version.Version1)
169+
err := setDynamoDBVersion(dynamoWrapper.Client, params.VersionTablename, version.Version1)
164170
So(err, ShouldBeNil)
165171
// we should skip the first patch
166172

@@ -181,7 +187,7 @@ func TestVersioningDynamoDB(t *testing.T) {
181187
})
182188
}
183189

184-
func setDynamoDBVersion(client *dynamodb.Client, vers string) error {
190+
func setDynamoDBVersion(client *dynamodb.Client, versTable, vers string) error {
185191
mdAttributeValue, err := attributevalue.Marshal(vers)
186192
if err != nil {
187193
return err
@@ -199,7 +205,7 @@ func setDynamoDBVersion(client *dynamodb.Client, vers string) error {
199205
Value: version.DBVersionKey,
200206
},
201207
},
202-
TableName: aws.String("Version"),
208+
TableName: aws.String(versTable),
203209
UpdateExpression: aws.String("SET #V = :Version"),
204210
})
205211

0 commit comments

Comments
 (0)