Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resiliency ubi-micro image #168

Merged
merged 26 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
67eb2ac
changes for podman
IsaiasA1 Jun 27, 2023
8e96f62
updated readme and other files
IsaiasA1 Jul 5, 2023
da475cd
updated makefile year
IsaiasA1 Jul 5, 2023
b5b5084
changed image to hardcode
IsaiasA1 Jul 5, 2023
779a41d
Merge branch 'main' into testing-ubi-micro
IsaiasA1 Jul 6, 2023
6e7c02d
updated actions.yaml
IsaiasA1 Jul 6, 2023
c661990
updated actions.yaml
IsaiasA1 Jul 6, 2023
f056247
updated actions.yaml
IsaiasA1 Jul 6, 2023
9615b97
updated actions.yaml
IsaiasA1 Jul 6, 2023
a8f1782
updated actions.yaml
IsaiasA1 Jul 6, 2023
826b07b
updated actions.yaml docker
IsaiasA1 Jul 7, 2023
e938600
updated actions.yaml local
IsaiasA1 Jul 7, 2023
13a2144
updated actions.yaml image name
IsaiasA1 Jul 7, 2023
f2ac986
updated actions.yaml dnf install
IsaiasA1 Jul 7, 2023
26f57d1
updated actions.yaml yum
IsaiasA1 Jul 7, 2023
7c53255
updated actions.yaml apt-update
IsaiasA1 Jul 7, 2023
7025cf5
updated actions.yaml podman build
IsaiasA1 Jul 7, 2023
6258070
updated actions.yaml podman socket
IsaiasA1 Jul 7, 2023
ab47dc7
updated actions.yaml podman image load
IsaiasA1 Jul 7, 2023
6b0bf7d
updated actions.yaml yum
IsaiasA1 Jul 7, 2023
85ed9bb
update to actions.yaml, checking os version
IsaiasA1 Jul 10, 2023
19e6bca
update to actions.yaml, removing flag
IsaiasA1 Jul 10, 2023
e7dc81e
update to actions.yaml clean
IsaiasA1 Jul 10, 2023
9b5d68e
updating github actions
IsaiasA1 Jul 11, 2023
25b10d2
adding back required build
IsaiasA1 Jul 11, 2023
f01ae87
updating make file and actions.yaml
IsaiasA1 Jul 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,18 @@ jobs:
- name: Install Mockgen
run: go get github.com/golang/mock/[email protected]
- name: Get dependencies
run: go mod download
run: go mod download ; sudo apt -y install dnf
- name: Mod tidy
run: go mod tidy
- name: Build podmon Docker Image
run: cd cmd/podmon ; make clean build; docker build -t podmon .
run: |
cd cmd/podmon
chmod +x ../../scripts/buildubimicro.sh
buildah unshare ../../scripts/buildubimicro.sh "registry.access.redhat.com/ubi9-micro:9.2-9"
make clean build
podman build -t docker.io/podmon . --build-arg BASEIMAGE="localhost/resiliency-ubimicro"
podman save docker.io/library/podmon -o /tmp/podmon.tar
docker load -i /tmp/podmon.tar
- name: Image scanner
uses: Azure/container-scan@v0
with:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2022 Dell Inc., or its subsidiaries. All Rights Reserved.
# Copyright (c) 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
# limitations under the License.
# Includes the following generated file to get semantic version information
all:
(cd cmd/podmon; make clean build docker push)
(cd cmd/podmon; make clean build-base-image build podman push)

check:
@scripts/check.sh ./internal/monitor ./internal/k8sapi ./internal/csiapi ./internal/criapi ./cmd/podmon
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2021-2022 Dell Inc., or its subsidiaries. All Rights Reserved.
Copyright (c) 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@
# Dell Container Storage Modules (CSM) for Resiliency
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](https://github.com/dell/csm/blob/main/docs/CODE_OF_CONDUCT.md)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Docker Pulls](https://img.shields.io/docker/pulls/dellemc/podmon)](https://hub.docker.com/r/dellemc/podmon)
[![Podmam Pulls](https://img.shields.io/docker/pulls/dellemc/podmon)](https://hub.docker.com/r/dellemc/podmon)
[![Go version](https://img.shields.io/github/go-mod/go-version/dell/karavi-resiliency)](go.mod)
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/dell/karavi-resiliency?include_prereleases&label=latest&style=flat-square)](https://github.com/dell/karavi-resiliency/releases/latest)
[![Releases](https://img.shields.io/badge/Releases-green.svg)](https://github.com/dell/karavi-resiliency/releases)
Expand Down Expand Up @@ -47,14 +47,15 @@ If you wish to clone and build CSM for Resiliency, a Linux host is required with

| Component | Version | Additional Information |
| --------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Docker | v19+ | [Docker installation](https://docs.docker.com/engine/install/) |
| Golang | v1.18+ | [Golang installation](https://github.com/travis-ci/gimme) |
| git | latest | [Git installation](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) |
| Podman | v4.4.1+ | [Podman installation](https://podman.io/docs/installation) |
| Buildah | v1.29.1+ | [Buildah installation](https://www.redhat.com/sysadmin/getting-started-buildah) |
| Golang | v1.18+ | [Golang installation](https://github.com/travis-ci/gimme) |
| git | latest | [Git installation](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) |

Once all prerequisites are on the Linux host, follow the steps below to clone, build and deploy CSM for Resiliency:

1. Clone the repository: `git clone https://github.com/dell/karavi-resiliency.git`
2. Define and export the following environment variables to point to your Docker registry:
2. Define and export the following environment variables to point to your Podman registry:

```
export REGISTRY_HOST=<registry host>
Expand Down
7 changes: 2 additions & 5 deletions cmd/podmon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM registry.access.redhat.com/ubi8/ubi:8.8-854
ARG BASEIMAGE
FROM $BASEIMAGE AS final
LABEL vendor="Dell Inc." \
name="csm-resiliency" \
summary="Dell Container Storage Modules (CSM) for Resiliency" \
description="Makes Kubernetes applications, including those that utilize persistent storage, more resilient to various failures" \
version="2.0.0" \
license="Apache-2.0"
RUN dnf -y install openssl && \
dnf -y install nettle && \
dnf -y install gnutls && \
dnf -y install systemd
COPY podmon /podmon
ENTRYPOINT [ "/podmon" ]
12 changes: 8 additions & 4 deletions cmd/podmon/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2022 Dell Inc., or its subsidiaries. All Rights Reserved.
# Copyright (c) 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,18 +17,22 @@ MINOR=0
PATCH=54
VERSION?="v$(MAJOR).$(MINOR).$(PATCH)"
REGISTRY?="${REGISTRY_HOST}:${REGISTRY_PORT}/podmon"
BASEIMAGE?="resiliency-micro:latest"

clean:
go clean ./...

build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-w' ./...

docker:
docker build --no-cache -t "$(REGISTRY):$(VERSION)" --label commit=$(shell git log --max-count 1 --format="%H") .
build-base-image:
sh ../../scripts/buildubimicro.sh "registry.access.redhat.com/ubi9-micro:9.2-9"

podman:
podman build --no-cache -t "$(REGISTRY):$(VERSION)" --build-arg BASEIMAGE=$(BASEIMAGE) --label commit=$(shell git log --max-count 1 --format="%H") .

push:
docker push "$(REGISTRY):$(VERSION)"
podman push "$(REGISTRY):$(VERSION)"

unit-test:
go test -race -v -coverprofile=c.out ./...
Expand Down
21 changes: 21 additions & 0 deletions scripts/buildubimicro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
# Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

microcontainer=$(buildah from $1)
micromount=$(buildah mount $microcontainer)
dnf install --installroot $micromount --releasever=8 --nodocs --setopt install_weak_deps=false openssl nettle gnutls systemd -y
dnf clean all --installroot $micromount
buildah umount $microcontainer
buildah commit $microcontainer resiliency-ubimicro
8 changes: 4 additions & 4 deletions test/podmontest/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2022 Dell Inc., or its subsidiaries. All Rights Reserved.
# Copyright (c) 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,10 +25,10 @@ build:
rm -f podmontest
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags podmontest -ldflags '-w' -o podmontest *.go

docker:
docker build -t "$(REGISTRY):$(VERSION)" --label commit=$(shell git log --max-count 1 --format="%H") .
podman:
podman build -t "$(REGISTRY):$(VERSION)" --label commit=$(shell git log --max-count 1 --format="%H") .

push:
docker push "$(REGISTRY):$(VERSION)"
podman push "$(REGISTRY):$(VERSION)"


Loading