mirror of
https://github.com/project-zot/zot.git
synced 2024-12-16 21:56:37 -05:00
ci: use runners provided by CNCF (#1946)
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
parent
7ab2032a21
commit
4cb7a6c755
5 changed files with 46 additions and 26 deletions
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
|
@ -18,7 +18,7 @@ jobs:
|
|||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-16-cores
|
||||
strategy:
|
||||
matrix:
|
||||
os: [linux, darwin, freebsd]
|
||||
|
|
10
.github/workflows/nightly.yaml
vendored
10
.github/workflows/nightly.yaml
vendored
|
@ -14,7 +14,7 @@ permissions: read-all
|
|||
jobs:
|
||||
dedupe:
|
||||
name: Dedupe/restore blobs
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-16-cores
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/clean-runner
|
||||
|
@ -62,7 +62,7 @@ jobs:
|
|||
|
||||
sync:
|
||||
name: Sync harness
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-16-cores
|
||||
steps:
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@v4
|
||||
|
@ -81,7 +81,7 @@ jobs:
|
|||
|
||||
gc-referrers-stress-s3:
|
||||
name: GC(with referrers) on S3(localstack) with short interval
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-16-cores
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/clean-runner
|
||||
|
@ -118,7 +118,7 @@ jobs:
|
|||
|
||||
gc-stress-s3:
|
||||
name: GC(without referrers) on S3(localstack) with short interval
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-16-cores
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/clean-runner
|
||||
|
@ -155,7 +155,7 @@ jobs:
|
|||
|
||||
docker-image:
|
||||
name: Build docker image (for users still using Docker environments)
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-16-cores
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/clean-runner
|
||||
|
|
7
.github/workflows/test.yaml
vendored
7
.github/workflows/test.yaml
vendored
|
@ -14,7 +14,7 @@ permissions: read-all
|
|||
jobs:
|
||||
test-run-minimal:
|
||||
name: Running zot without extensions tests
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-16-cores
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/clean-runner
|
||||
|
@ -57,7 +57,7 @@ jobs:
|
|||
- uses: ./.github/actions/teardown-localstack
|
||||
test-run-extensions:
|
||||
name: Run zot with extensions tests
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-16-cores
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/clean-runner
|
||||
|
@ -80,7 +80,6 @@ jobs:
|
|||
cd $GITHUB_WORKSPACE
|
||||
go mod download
|
||||
- uses: ./.github/actions/setup-localstack
|
||||
- uses: ./.github/actions/check-diskspace
|
||||
- name: run zot extended tests
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE
|
||||
|
@ -99,7 +98,7 @@ jobs:
|
|||
- uses: ./.github/actions/teardown-localstack
|
||||
test-run-devmode:
|
||||
name: Running privileged tests on Linux
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-16-cores
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/clean-runner
|
||||
|
|
|
@ -1451,8 +1451,11 @@ func (dwr *DynamoDB) createRepoMetaTable() error {
|
|||
},
|
||||
BillingMode: types.BillingModePayPerRequest,
|
||||
})
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "Table already exists") {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -1517,8 +1520,11 @@ func (dwr *DynamoDB) createManifestDataTable() error {
|
|||
},
|
||||
BillingMode: types.BillingModePayPerRequest,
|
||||
})
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "Table already exists") {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -1542,9 +1548,12 @@ func (dwr *DynamoDB) createIndexDataTable() error {
|
|||
},
|
||||
BillingMode: types.BillingModePayPerRequest,
|
||||
})
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "Table already exists") {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err != nil && strings.Contains(err.Error(), "Table already exists") {
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
return dwr.waitTableToBeCreated(dwr.IndexDataTablename)
|
||||
|
@ -1837,8 +1846,11 @@ func (dwr *DynamoDB) createUserDataTable() error {
|
|||
},
|
||||
BillingMode: types.BillingModePayPerRequest,
|
||||
})
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "Table already exists") {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -1862,8 +1874,11 @@ func (dwr DynamoDB) createAPIKeyTable() error {
|
|||
},
|
||||
BillingMode: types.BillingModePayPerRequest,
|
||||
})
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "Table already exists") {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
guuid "github.com/gofrs/uuid"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"go.etcd.io/bbolt"
|
||||
|
||||
|
@ -116,16 +117,21 @@ func setBoltDBVersion(db *bbolt.DB, vers string) error {
|
|||
func TestVersioningDynamoDB(t *testing.T) {
|
||||
tskip.SkipDynamo(t)
|
||||
|
||||
uuid, err := guuid.NewV4()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Convey("Tests", t, func() {
|
||||
params := mdynamodb.DBDriverParameters{
|
||||
Endpoint: os.Getenv("DYNAMODBMOCK_ENDPOINT"),
|
||||
Region: "us-east-2",
|
||||
RepoMetaTablename: "RepoMetadataTable",
|
||||
ManifestDataTablename: "ManifestDataTable",
|
||||
IndexDataTablename: "IndexDataTable",
|
||||
UserDataTablename: "UserDataTable",
|
||||
APIKeyTablename: "ApiKeyTable",
|
||||
VersionTablename: "Version",
|
||||
RepoMetaTablename: "RepoMetadataTable" + uuid.String(),
|
||||
ManifestDataTablename: "ManifestDataTable" + uuid.String(),
|
||||
IndexDataTablename: "IndexDataTable" + uuid.String(),
|
||||
UserDataTablename: "UserDataTable" + uuid.String(),
|
||||
APIKeyTablename: "ApiKeyTable" + uuid.String(),
|
||||
VersionTablename: "Version" + uuid.String(),
|
||||
}
|
||||
|
||||
dynamoClient, err := mdynamodb.GetDynamoClient(params)
|
||||
|
@ -140,7 +146,7 @@ func TestVersioningDynamoDB(t *testing.T) {
|
|||
So(dynamoWrapper.ResetRepoMetaTable(), ShouldBeNil)
|
||||
|
||||
Convey("dbVersion is empty", func() {
|
||||
err := setDynamoDBVersion(dynamoWrapper.Client, "")
|
||||
err := setDynamoDBVersion(dynamoWrapper.Client, params.VersionTablename, "")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
err = dynamoWrapper.PatchDB()
|
||||
|
@ -160,7 +166,7 @@ func TestVersioningDynamoDB(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
err := setDynamoDBVersion(dynamoWrapper.Client, version.Version1)
|
||||
err := setDynamoDBVersion(dynamoWrapper.Client, params.VersionTablename, version.Version1)
|
||||
So(err, ShouldBeNil)
|
||||
// we should skip the first patch
|
||||
|
||||
|
@ -181,7 +187,7 @@ func TestVersioningDynamoDB(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func setDynamoDBVersion(client *dynamodb.Client, vers string) error {
|
||||
func setDynamoDBVersion(client *dynamodb.Client, versTable, vers string) error {
|
||||
mdAttributeValue, err := attributevalue.Marshal(vers)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -199,7 +205,7 @@ func setDynamoDBVersion(client *dynamodb.Client, vers string) error {
|
|||
Value: version.DBVersionKey,
|
||||
},
|
||||
},
|
||||
TableName: aws.String("Version"),
|
||||
TableName: aws.String(versTable),
|
||||
UpdateExpression: aws.String("SET #V = :Version"),
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue