Skip to content

Commit

Permalink
ci: use runners provided by CNCF
Browse files Browse the repository at this point in the history
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
  • Loading branch information
rchincha authored and adodon2go committed Oct 19, 2023
1 parent a44ca57 commit 291a7c6
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,6 +41,8 @@ jobs:
- uses: ./.github/actions/check-diskspace
- name: run zot minimal tests
run: |
lscpu
free --giga -h -t
cd $GITHUB_WORKSPACE
make test-minimal
env:
Expand All @@ -57,7 +59,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
Expand Down Expand Up @@ -99,7 +101,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
Expand Down
30 changes: 23 additions & 7 deletions pkg/api/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"testing"
"time"

guuid "github.com/gofrs/uuid"
"github.com/google/go-github/v52/github"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
Expand Down Expand Up @@ -152,12 +153,17 @@ func TestCreateCacheDatabaseDriver(t *testing.T) {
}

endpoint := os.Getenv("DYNAMODBMOCK_ENDPOINT")
uuid, err := guuid.NewV4()
if err != nil {
panic(err)
}
tableName := "RepoTable-" + uuid.String()
conf.Storage.CacheDriver = map[string]interface{}{
"name": "dynamodb",
"endpoint": endpoint,
"region": "us-east-2",
"cacheTablename": "BlobTable",
"repoMetaTablename": "RepoMetadataTable",
"repoMetaTablename": tableName,
"manifestDataTablename": "ManifestDataTable",
"userDataTablename": "ZotUserDataTable",
"versionTablename": "Version",
Expand All @@ -172,7 +178,7 @@ func TestCreateCacheDatabaseDriver(t *testing.T) {
"endpoint": endpoint,
"region": "us-east-2",
"cacheTablename": "BlobTable",
"repoMetaTablename": "RepoMetadataTable",
"repoMetaTablename": tableName,
"manifestDataTablename": "ManifestDataTable",
"userDataTablename": "ZotUserDataTable",
"versionTablename": "Version",
Expand All @@ -186,7 +192,7 @@ func TestCreateCacheDatabaseDriver(t *testing.T) {
"endpoint": endpoint,
"region": "us-east-2",
"cacheTablename": "BlobTable",
"repoMetaTablename": "RepoMetadataTable",
"repoMetaTablename": tableName,
"manifestDataTablename": "ManifestDataTable",
"userDataTablename": "ZotUserDataTable",
"versionTablename": "Version",
Expand Down Expand Up @@ -214,12 +220,17 @@ func TestCreateMetaDBDriver(t *testing.T) {
"skipverify": false,
}

uuid, err := guuid.NewV4()
if err != nil {
panic(err)
}
tableName := "RepoTable-" + uuid.String()
conf.Storage.CacheDriver = map[string]interface{}{
"name": "dummy",
"endpoint": "http://localhost:4566",
"region": "us-east-2",
"cachetablename": "BlobTable",
"repometatablename": "RepoMetadataTable",
"repometatablename": tableName,
"manifestdatatablename": "ManifestDataTable",
"userdatatablename": "UserDatatable",
}
Expand All @@ -232,7 +243,7 @@ func TestCreateMetaDBDriver(t *testing.T) {
"endpoint": "http://localhost:4566",
"region": "us-east-2",
"cachetablename": "",
"repometatablename": "RepoMetadataTable",
"repometatablename": tableName,
"manifestdatatablename": "ManifestDataTable",
"userDataTablename": "ZotUserDataTable",
"versiontablename": 1,
Expand All @@ -246,7 +257,7 @@ func TestCreateMetaDBDriver(t *testing.T) {
"endpoint": "http://localhost:4566",
"region": "us-east-2",
"cachetablename": "test",
"repometatablename": "RepoMetadataTable",
"repometatablename": tableName,
"manifestdatatablename": "ManifestDataTable",
"indexdatatablename": "IndexDataTable",
"userdatatablename": "ZotUserDataTable",
Expand Down Expand Up @@ -423,12 +434,17 @@ func TestObjectStorageController(t *testing.T) {
conf.Storage.RemoteCache = true
conf.Storage.StorageDriver = storageDriverParams

uuid, err := guuid.NewV4()
if err != nil {
panic(err)
}
tableName := "RepoTable-" + uuid.String()
conf.Storage.CacheDriver = map[string]interface{}{
"name": "dynamodb",
"endpoint": os.Getenv("DYNAMODBMOCK_ENDPOINT"),
"region": "us-east-2",
"cachetablename": "test",
"repometatablename": "RepoMetadataTable",
"repometatablename": tableName,
"manifestdatatablename": "ManifestDataTable",
"indexdatatablename": "IndexDataTable",
"userdatatablename": "ZotUserDataTable",
Expand Down
7 changes: 6 additions & 1 deletion pkg/meta/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2691,10 +2691,15 @@ func generateTestImage() ([]byte, []byte, error) {
func TestCreateDynamo(t *testing.T) {
tskip.SkipDynamo(t)

uuid, err := guuid.NewV4()
if err != nil {
panic(err)
}

Convey("Create", t, func() {
dynamoDBDriverParams := mdynamodb.DBDriverParameters{
Endpoint: os.Getenv("DYNAMODBMOCK_ENDPOINT"),
RepoMetaTablename: "RepoMetadataTable",
RepoMetaTablename: "RepoMetadataTable" + uuid.String(),
ManifestDataTablename: "ManifestDataTable",
IndexDataTablename: "IndexDataTable",
UserDataTablename: "UserDataTable",
Expand Down
8 changes: 7 additions & 1 deletion pkg/meta/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path"
"testing"

guuid "github.com/gofrs/uuid"
godigest "github.com/opencontainers/go-digest"
ispec "github.com/opencontainers/image-spec/specs-go/v1"
. "github.com/smartystreets/goconvey/convey"
Expand Down Expand Up @@ -397,13 +398,18 @@ func TestParseStorageWithBoltDB(t *testing.T) {
func TestParseStorageDynamoWrapper(t *testing.T) {
tskip.SkipDynamo(t)

uuid, err := guuid.NewV4()
if err != nil {
panic(err)
}

Convey("Dynamodb", t, func() {
rootDir := t.TempDir()

params := dynamodb.DBDriverParameters{
Endpoint: os.Getenv("DYNAMODBMOCK_ENDPOINT"),
Region: "us-east-2",
RepoMetaTablename: "RepoMetadataTable",
RepoMetaTablename: "RepoMetadataTable" + uuid.String(),
ManifestDataTablename: "ManifestDataTable",
IndexDataTablename: "IndexDataTable",
UserDataTablename: "UserDataTable",
Expand Down
8 changes: 7 additions & 1 deletion pkg/meta/version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -116,11 +117,16 @@ 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",
RepoMetaTablename: "RepoMetadataTable" + uuid.String(),
ManifestDataTablename: "ManifestDataTable",
IndexDataTablename: "IndexDataTable",
UserDataTablename: "UserDataTable",
Expand Down

0 comments on commit 291a7c6

Please sign in to comment.