Skip to content

Commit

Permalink
refact(container): standarize base image and more
Browse files Browse the repository at this point in the history
- Changed the base image of all containers to point to openebs/linux-utils
- push containers to ghcr as well
- for release, redirect to maya documentation
- cleanup unused arg BASE_IMAGE

Signed-off-by: kmova <[email protected]>
  • Loading branch information
kmova committed Sep 10, 2021
1 parent 4216be8 commit b9b5ea2
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 46 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
images: |
${{ env.IMAGE_ORG }}/openebs-k8s-provisioner
quay.io/${{ env.IMAGE_ORG }}/openebs-k8s-provisioner
ghcr.io/${{ env.IMAGE_ORG }}/openebs-k8s-provisioner
tag-latest: false
tag-custom-only: true
tag-custom: |
Expand Down Expand Up @@ -111,6 +112,13 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Image
uses: docker/build-push-action@v2
with:
Expand Down Expand Up @@ -163,6 +171,7 @@ jobs:
images: |
${{ env.IMAGE_ORG }}/snapshot-provisioner
quay.io/${{ env.IMAGE_ORG }}/snapshot-provisioner
ghcr.io/${{ env.IMAGE_ORG }}/snapshot-provisioner
tag-latest: false
tag-custom-only: true
tag-custom: |
Expand Down Expand Up @@ -198,6 +207,13 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Image
uses: docker/build-push-action@v2
with:
Expand Down Expand Up @@ -250,6 +266,7 @@ jobs:
images: |
${{ env.IMAGE_ORG }}/snapshot-controller
quay.io/${{ env.IMAGE_ORG }}/snapshot-controller
ghcr.io/${{ env.IMAGE_ORG }}/snapshot-controller
tag-latest: false
tag-custom-only: true
tag-custom: |
Expand Down Expand Up @@ -285,6 +302,13 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Image
uses: docker/build-push-action@v2
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
images: |
${{ env.IMAGE_ORG }}/openebs-k8s-provisioner
quay.io/${{ env.IMAGE_ORG }}/openebs-k8s-provisioner
ghcr.io/${{ env.IMAGE_ORG }}/openebs-k8s-provisioner
tag-latest: true
tag-semver: |
{{version}}
Expand Down Expand Up @@ -85,6 +86,13 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Image
uses: docker/build-push-action@v2
with:
Expand Down Expand Up @@ -131,6 +139,7 @@ jobs:
images: |
${{ env.IMAGE_ORG }}/snapshot-provisioner
quay.io/${{ env.IMAGE_ORG }}/snapshot-provisioner
ghcr.io/${{ env.IMAGE_ORG }}/snapshot-provisioner
tag-latest: true
tag-semver: |
{{version}}
Expand Down Expand Up @@ -164,6 +173,13 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Image
uses: docker/build-push-action@v2
with:
Expand Down Expand Up @@ -210,6 +226,7 @@ jobs:
images: |
${{ env.IMAGE_ORG }}/snapshot-controller
quay.io/${{ env.IMAGE_ORG }}/snapshot-controller
ghcr.io/${{ env.IMAGE_ORG }}/snapshot-controller
tag-latest: true
tag-semver: |
{{version}}
Expand Down Expand Up @@ -243,6 +260,13 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Image
uses: docker/build-push-action@v2
with:
Expand Down
16 changes: 1 addition & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ export XC_ARCH
ARCH:=${XC_OS}_${XC_ARCH}
export ARCH

ifeq (${BASE_DOCKER_IMAGEARM64}, )
BASE_DOCKER_IMAGEARM64 = "arm64v8/ubuntu:18.04"
export BASE_DOCKER_IMAGEARM64
endif

ifeq (${ARCH},linux_arm64)
BASEIMAGE:=${BASE_DOCKER_IMAGEARM64}
else
# The ubuntu:16.04 image is being used as base image.
BASEIMAGE:=ubuntu:16.04
endif
export BASEIMAGE

ifeq (${IMAGE_ORG}, )
IMAGE_ORG=openebs
export IMAGE_ORG
Expand Down Expand Up @@ -81,7 +68,7 @@ build:

image: build
@cp openebs-provisioner buildscripts/provisioner
@cd buildscripts/provisioner && sudo docker build -t ${DIMAGE}:ci ${DBUILD_ARGS} --build-arg BASE_IMAGE=${BASEIMAGE} .
@cd buildscripts/provisioner && sudo docker build -t ${DIMAGE}:ci ${DBUILD_ARGS} .


deploy:
Expand All @@ -90,7 +77,6 @@ deploy:
@sh buildscripts/push

clean:
rm -rf vendor
rm -f openebs-provisioner
rm -f buildscripts/docker/openebs-provisioner
rm -f buildscripts/snapshot-controller/snapshot-controller
Expand Down
36 changes: 14 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,29 @@ _Note: We recommend OpenEBS users to shift towards CSI based provisioner availab

This provisioner is based on the Kubenretes external storage provisioner. This code has been migrated from https://github.com/openebs/external-storage/tree/release/openebs, as Kubernetes community deprecated the external-storage repository.

This repository mainly contains code required for running the legacy cStor and Jiva pools and volumes like:
This repository contains code for building legacy cStor and Jiva provisioners like:
- `openebs-k8s-provisioner` - used for provisoining the legacy cStor and Jiva pools and volumes.
- `snapshot-controller` and `snapshot-operator` - for helping with snapshot and clone on legacy cStor volumes.

## Install

Please refer to our documentation at [OpenEBS Documentation](http://openebs.io/).

## Building from source

```
$ make all
```

## Create a docker image

```
$ make container
```

## Release

Prior to creating a release tag on this repository on `v2.12.x` branch with the required fixes, ensure that the dependent data engine repositories and provisioner are tagged. Once the code is merged, use the following sequence to release a new version for the legacy components:
- (Optional) New release tag on v2.12.x branch of [openebs/linux-utils](https://github.com/openebs/linux-utils)
- (Optional) New release tag on v0.6.x branch of [openebs/ndm](https://github.com/openebs/node-disk-manager)
- New release tag on v2.12.x branch of [openebs/cstor](https://github.com/openebs/cstor) and [openebs/libcstor](https://github.com/openebs/libcstor)
- New release tag on v2.12.x branch of [openebs/jiva](https://github.com/openebs/jiva)
- New release tag on v2.12.x branch of [openebs/openebs-k8s-provisioner](https://github.com/openebs/openebs-k8s-provisioner)
- New release tag on v2.12.x branch of [openebs/m-exporter](https://github.com/openebs/m-exporter)
- New release tag on v2.12.x branch of [openebs/maya](https://github.com/openebs/maya)
- New release tag on v2.12.x branch of [openebs/velero-plugin](https://github.com/openebs/velero-plugin)
The containers from this repo have to built along with other control plane components. The detailed steps for making a new release are at: https://github.com/openebs/maya/blob/HEAD/README.md#release

## Contributing

Expand All @@ -45,17 +49,5 @@ OpenEBS welcomes your feedback and contributions in any form possible.



## Building OpenEBS provisioners from source

```
$ make all
```

## Create a docker image

```
$ make container
```

## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fopenebs%2Fopenebs-k8s-provisioner.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenebs%2Fopenebs-k8s-provisioner?ref=badge_large)
3 changes: 1 addition & 2 deletions buildscripts/provisioner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG BASE_IMAGE=ubuntu:16.04
FROM $BASE_IMAGE
FROM openebs/linux-utils:2.12.x-ci
COPY openebs-provisioner /

ARG ARCH
Expand Down
4 changes: 1 addition & 3 deletions buildscripts/provisioner/provisioner.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ COPY . .

RUN make build

FROM ubuntu:16.04
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update; exit 0
FROM openebs/linux-utils:2.12.x-ci

COPY --from=build /go/src/github.com/openebs/openebs-k8s-provisioner/openebs-provisioner /

Expand Down
2 changes: 1 addition & 1 deletion buildscripts/snapshot-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.11.5
FROM openebs/linux-utils:2.12.x-ci

RUN apk add --no-cache \
bash \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ COPY . .

RUN make snapshot-controller

FROM alpine:3.11.5
FROM openebs/linux-utils:2.12.x-ci

RUN apk add --no-cache \
bash \
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/snapshot-provisioner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.11.5
FROM openebs/linux-utils:2.12.x-ci

RUN apk add --no-cache \
bash \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ COPY . .

RUN make snapshot-provisioner

FROM alpine:3.11.5
FROM openebs/linux-utils:2.12.x-ci

RUN apk add --no-cache \
bash \
Expand Down

0 comments on commit b9b5ea2

Please sign in to comment.