From 6de3c0c8d3a6d6c60841ec5e2b2c04908722a39a Mon Sep 17 00:00:00 2001 From: guacamole Date: Tue, 31 Aug 2021 12:48:02 +0530 Subject: [PATCH] adding github actions Signed-off-by: gunjan valecha Signed-off-by: guacamole --- .github/workflows/go.yml | 46 ++++++++++++++++++++++++++++++++++++++++ Dockerfile | 6 +++--- conformance.vars | 16 ++++++++------ env-vars.example | 12 +++++------ go.sum | 4 ++++ 5 files changed, 68 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..25ac2db3 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,46 @@ +name: conformance + +on: + pull_request: + +jobs: + run-conformance-test: + runs-on: ubuntu-latest + steps: + - name: set up docker + uses: docker-practice/actions-setup-docker@0.0.1 + with: + docker_version: 18.09 + docker_channel: stable + - uses: actions/checkout@v2 + - name: start distribution server + run: | + IP=`hostname -I | awk '{print $1}'` + echo "IP=$IP" >> $GITHUB_ENV + echo "OCI_ROOT_URL=http://$IP:5000" >> $GITHUB_ENV + DISTRIBUTION_REF="local-distribution:v$(date +%Y%m%d%H%M%S)" + docker build -f ./Dockerfile -t "${DISTRIBUTION_REF}" . + docker run --rm -p 5000:5000 --env-file ./env-vars.example -e REGISTRY_STORAGE_DELETE_ENABLED=true -idt "${DISTRIBUTION_REF}" + curl -XPOST -d ${{ secrets.OPENREGISTRY_SIGNUP_PAYLOAD }} "http://${IP}:5000/auth/signup" + - name: Run OCI Distribution Spec conformance tests + uses: opencontainers/distribution-spec@main + env: + OCI_ROOT_URL: ${{ env.OCI_ROOT_URL }} + OCI_USERNAME: ${{ secrets.OPENREGISTRY_USERNAME }} + OCI_PASSWORD: ${{ secrets.OPENREGISTRY_PASSWORD }} + OCI_NAMESPACE: ${{ secrets.OPENREGISTRY_USERNAME }}/distribution-test + OCI_TEST_PULL: 1 + OCI_TEST_PUSH: 1 + OCI_TEST_CONTENT_DISCOVERY: 1 + OCI_TEST_CONTENT_MANAGEMENT: 1 + OCI_HIDE_SKIPPED_WORKFLOWS: 1 + OCI_DEBUG: 0 + OCI_DELETE_MANIFEST_BEFORE_BLOBS: 0 + - run: mkdir -p .out/ && mv {report.html,junit.xml} .out/ + if: always() + - name: Upload test results zip as build artifact + uses: actions/upload-artifact@v1 + with: + name: oci-test-results-${{ github.sha }} + path: .out/ + if: always() \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index dcd799af..9e2311c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,13 +4,13 @@ WORKDIR /root/openregistry COPY . . -RUN apk add gcc make git curl ca-certificates && go mod download github.com/NebulousLabs/go-skynet/v2 && make mod-fix && go mod download +RUN apk add gcc make git curl ca-certificates && make mod-fix && go mod download RUN CGO_ENABLED=0 go build -o openregistry -ldflags="-w -s" main.go FROM alpine:latest COPY --from=build /root/openregistry/openregistry . -COPY ./config.yaml . -EXPOSE 80 +#COPY ./config.yaml . +EXPOSE 5000 CMD ["./openregistry"] diff --git a/conformance.vars b/conformance.vars index cf0c5bb2..a6019a66 100644 --- a/conformance.vars +++ b/conformance.vars @@ -1,7 +1,9 @@ -export OCI_ROOT_URL=http://100.87.37.43:5000 -export OCI_NAMESPACE=jasdeepsingh/dummmy-server-2 -export OCI_CROSSMOUNT_NAMESPACE=jasdeepsingh/dummmy-server-cross-mount -export OCI_USERNAME=jasdeepsingh -export OCI_PASSWORD=jasdeepsinH12 -export OCI_TEST_PULL=1 -export OCI_TEST_PUSH=1 +OCI_ROOT_URL=http://192.168.0.121:5001 +OCI_NAMESPACE=johndoe/dummmy-server +OCI_CROSSMOUNT_NAMESPACE=johndoe/dummmy-server-cross-mount +OCI_USERNAME=johndoe +OCI_PASSWORD=Qwerty@123 +OCI_TEST_PULL=1 +OCI_TEST_PUSH=1 +OCI_TEST_CONTENT_DISCOVERY=1 +OCI_TEST_CONTENT_MANAGEMENT=1 \ No newline at end of file diff --git a/env-vars.example b/env-vars.example index 6e43cb4f..4c91613c 100644 --- a/env-vars.example +++ b/env-vars.example @@ -1,6 +1,6 @@ -export OPEN_REGISTRY_DEBUG=true -export OPEN_REGISTRY_DOMAIN="beta.openregistry.dev" -export OPEN_REGISTRY_HOST="100.87.37.43" -export OPEN_REGISTRY_PORT="5000" -export OPEN_REGISTRY_SKYNET_PORTAL_URL="https://siasky.net" -export OPEN_REGISTRY_SIGNING_SECRET="3tYnaKp@^%hbQA%J&x3cX!r2#mK%EBfAbTvPMv5CU2DP7bAoQGnUfT2&dW" +OPEN_REGISTRY_DEBUG=true +OPEN_REGISTRY_DOMAIN=beta.openregistry.dev +OPEN_REGISTRY_HOST=0.0.0.0 +OPEN_REGISTRY_PORT=5000 +OPEN_REGISTRY_SKYNET_PORTAL_URL=https://siasky.net +OPEN_REGISTRY_SIGNING_SECRET=3tYnaKp@^%hbQA%J&x3cX!r2#mK%EBfAbTvPMv5CU2DP7bAoQGnUfT2&dW diff --git a/go.sum b/go.sum index 3ddc523e..a986ddde 100644 --- a/go.sum +++ b/go.sum @@ -69,6 +69,7 @@ github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg3 github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= +github.com/Microsoft/hcsshim v0.8.18/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -177,8 +178,11 @@ github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7 github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= +github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= github.com/containerd/containerd v1.5.2 h1:MG/Bg1pbmMb61j3wHCFWPxESXHieiKr2xG64px/k8zQ= github.com/containerd/containerd v1.5.2/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= +github.com/containerd/containerd v1.5.4 h1:uPF0og3ByFzDnaStfiQj3fVGTEtaSNyU+bW7GR/nqGA= +github.com/containerd/containerd v1.5.4/go.mod h1:sx18RgvW6ABJ4iYUw7Q5x7bgFOAB9B6G7+yO0XBc4zw= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=