Skip to content

Commit

Permalink
Merge branch 'master' into Refactor-fix-typo-on-AzureClientId-and-Azu…
Browse files Browse the repository at this point in the history
…reClientSecret

Signed-off-by: Le Tran <[email protected]>
  • Loading branch information
leuyentran authored and Le Tran committed Sep 8, 2022
2 parents 66cfc98 + ea16889 commit fc204f1
Show file tree
Hide file tree
Showing 113 changed files with 2,800 additions and 445 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: tar -xvf ./src.tar.gz
- run: make update-kopia-image
- run: make release-snapshot
- run: ./build/push_images.sh
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ DOCKER_CONFIG ?= "$(HOME)/.docker"

# Mention the vm-driver that should be used to install OpenShift
vm-driver ?= "kvm"

# Refers to https://github.com/kopia/kopia/commit/317cc36892707ab9bdc5f6e4dea567d1e638a070
KOPIA_COMMIT_ID ?= "317cc36"

KOPIA_REPO ?= "kopia"
# Default OCP version in which the OpenShift apps are going to run
ocp_version ?= "4.10"
###
Expand Down Expand Up @@ -257,6 +262,9 @@ gorelease:
release-snapshot:
@$(MAKE) run CMD='-c "GORELEASER_CURRENT_TAG=v9.99.9-dev goreleaser --debug release --rm-dist --snapshot"'

update-kopia-image:
@/bin/bash ./build/update_kopia_image.sh $(KOPIA_COMMIT_ID) $(KOPIA_REPO)

go-mod-download:
@$(MAKE) run CMD='-c "go mod download"'

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ The Kanister architecture is documented
If you have any questions or run into issues, feel free to reach out to us on
[Slack](https://kanisterio.slack.com).

GitHub issues or pull requests that have been inactive for more than 60 days
will be labeled as stale. If they remained inactive for another 30 days, they
will be automatically closed. To be exempted from the issue lifecycle, discuss
with a maintainer the reasons behind the exemption, and add the `frozen` label
to the issue or pull request.

If you discovered any security issues, refer to our [`SECURITY.md`](SECURITY.md)
documentation for our security policy, including steps on how to report
vulnerabilities.
Expand Down
36 changes: 36 additions & 0 deletions build/update_kopia_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Copyright 2022 The Kanister Authors.
#
# 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.

set -o errexit
set -o nounset

IMAGE_REGISTRY="ghcr.io/kanisterio"

readonly COMMIT_ID=${1:?"Commit id to build kopia image not specified"}
readonly KOPIA_REPO_ORG=${2-:"kopia"}
readonly IMAGE_TYPE=alpine
readonly IMAGE_BUILD_VERSION="${COMMIT_ID}"
readonly GH_PACKAGE_TARGET="${IMAGE_REGISTRY}/kopia"
readonly TAG="${IMAGE_TYPE}-${IMAGE_BUILD_VERSION}"


docker build \
--tag "${GH_PACKAGE_TARGET}:${TAG}" \
--build-arg "kopiaBuildCommit=${COMMIT_ID}" \
--build-arg "kopiaRepoOrg=${KOPIA_REPO_ORG}" \
--file ./docker/kopia-build/Dockerfile .

docker push ${GH_PACKAGE_TARGET}:$TAG
45 changes: 45 additions & 0 deletions docker/kopia-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM golang:1.19.1-alpine3.16 AS builder

ARG kopiaBuildCommit
ARG kopiaRepoOrg

RUN apk add git

WORKDIR /

RUN git clone https://github.com/${kopiaRepoOrg}/kopia.git

ENV GITHUB_REPOSITORY=https://github.com/${kopiaRepoOrg}/kopia

WORKDIR /kopia

# Build kopia binary from specific commit
RUN git checkout ${kopiaBuildCommit}
# Refers to goreleaser/goreleaser:v1.11.2
COPY --from=docker.io/goreleaser/goreleaser@sha256:b13418f20019fffb29797aff3d03f5e9ca84cea93634f4169a7ed603a95ab198 \
/usr/bin/goreleaser /usr/bin/goreleaser
RUN goreleaser build --output=. --rm-dist --single-target

RUN adduser -D kopia && addgroup kopia kopia
USER kopia:kopia

COPY --chown=kopia . /kopia

FROM alpine:3.16

WORKDIR /kopia

# Add CA certs
RUN apk add --no-cache --verbose ca-certificates && \
rm -rf /var/cache/apk/* && \
adduser -D kopia && addgroup kopia kopia && \
chown kopia /kopia

USER kopia:kopia

ENTRYPOINT [ "/kopia/kopia" ]

LABEL imageVersion="${imageVersion}"
LABEL kopiaBuildCommit="${kopiaBuildCommit}"

COPY --from=builder --chown=kopia:kopia /kopia/kopia /kopia/kopia
4 changes: 2 additions & 2 deletions docker/tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ LABEL name="kanister-tools" \
description="Kanister tools for application-specific data management"

COPY --from=restic/restic:0.11.0 /usr/bin/restic /usr/local/bin/restic
# kastenhq/kopia alpine-sha-7664c8c image
COPY --from=ghcr.io/kastenhq/kopia@sha256:540e05631dc48428725dc938ce62d7e4c1e698ba1fc6956ad36dd349ad076a20 \
# ghcr.io/kanisterio/kopia:alpine-317cc36
COPY --from=ghcr.io/kanisterio/kopia@sha256:87648ef24ce47f1d74ef5fa70bff96080f686b849dd0d787e1699d4c05807c4b \
/kopia/kopia /usr/local/bin/kopia
COPY LICENSE /licenses/LICENSE

Expand Down
10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,13 @@ These guidelines are derived from the
[cheatsheet](https://github.com/kubernetes/community/blob/master/contributors/guide/style-guide.md#cheatsheet-content-design-formatting-and-language)
in the Kubernetes community style guide. Take a look at some of their examples
[here](https://github.com/kubernetes/community/blob/master/contributors/guide/style-guide.md#language-grammar-and-tone).

## reStructured Text Styling Guide

* Use `*` for bullet points.
* Section headers are created using underlines with text. Underlining hierarchy is:
* `*` for chapters
* `=` for sections
* `-` for subsections
* `^` for subsubsections
* `"` for paragraphs
2 changes: 1 addition & 1 deletion examples/aws-rds/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This example is to demonstrate how Kanister can be integrated with AWS RDS insta
## Prerequisites

- Kubernetes 1.10+
- Kanister controller version 0.81.0 installed in your cluster
- Kanister controller version 0.82.0 installed in your cluster
- Kanctl CLI installed (https://docs.kanister.io/tooling.html#kanctl)

## Create RDS instance on AWS
Expand Down
6 changes: 3 additions & 3 deletions examples/aws-rds/postgresql/rds-postgres-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ actions:
- func: KubeTask
name: backupSnapshots
args:
image: "ghcr.io/kanisterio/postgres-kanister-tools:0.81.0"
image: "ghcr.io/kanisterio/postgres-kanister-tools:0.82.0"
namespace: "{{ .Object.metadata.namespace }}"
command:
- bash
Expand Down Expand Up @@ -49,7 +49,7 @@ actions:
- func: KubeTask
name: restoreSnapshots
args:
image: "ghcr.io/kanisterio/postgres-kanister-tools:0.81.0"
image: "ghcr.io/kanisterio/postgres-kanister-tools:0.82.0"
namespace: "{{ .Object.metadata.namespace }}"
command:
- bash
Expand Down Expand Up @@ -86,7 +86,7 @@ actions:
- func: KubeTask
name: restoreSnapshots
args:
image: "ghcr.io/kanisterio/postgres-kanister-tools:0.81.0"
image: "ghcr.io/kanisterio/postgres-kanister-tools:0.82.0"
namespace: "{{ .Namespace.Name }}"
command:
- bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ actions:
name: deleteBackup
args:
namespace: "{{ .Namespace.Name }}"
image: ghcr.io/kanisterio/kanister-tools:0.81.0
image: ghcr.io/kanisterio/kanister-tools:0.82.0
command:
- bash
- -o
Expand Down
4 changes: 2 additions & 2 deletions examples/cassandra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ As the official documentation of [Cassandra](http://cassandra.apache.org/) says,
* Kubernetes 1.9+
* Kubernetes beta APIs enabled only if `podDisruptionBudget` is enabled
* PV support on the underlying infrastructure
* Kanister controller version 0.81.0 installed in your cluster, let's say in namespace `<kanister-operator-namespace>`
* Kanister controller version 0.82.0 installed in your cluster, let's say in namespace `<kanister-operator-namespace>`
* Kanctl CLI installed (https://docs.kanister.io/tooling.html#kanctl)

To install kanister and related tools you can follow [this](https://docs.kanister.io/install.html#install) link.
Expand All @@ -29,7 +29,7 @@ $ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm repo update
# remove app-namespace with the namespace you want to deploy the Cassandra app in
$ kubectl create ns <app-namespace>
$ helm install cassandra bitnami/cassandra --namespace <app-namespace> --set image.repository=kanisterio/cassandra --set image.tag=0.81.0 --set cluster.replicaCount=2 --set image.registry=ghcr.io --set image.pullPolicy=Always
$ helm install cassandra bitnami/cassandra --namespace <app-namespace> --set image.repository=kanisterio/cassandra --set image.tag=0.82.0 --set cluster.replicaCount=2 --set image.registry=ghcr.io --set image.pullPolicy=Always


```
Expand Down
2 changes: 1 addition & 1 deletion examples/cassandra/cassandra-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ actions:
name: restoreFromObjectStore
args:
namespace: "{{ .StatefulSet.Namespace }}"
image: ghcr.io/kanisterio/kanister-tools:0.81.0
image: ghcr.io/kanisterio/kanister-tools:0.82.0
backupArtifactPrefix: "{{ .ArtifactsIn.params.KeyValue.backupPrefixLocation }}"
pods: "{{ range .StatefulSet.Pods }} {{.}}{{end}}"
restorePath: "{{ .ArtifactsIn.params.KeyValue.restorePathPrefix }}"
Expand Down
Loading

0 comments on commit fc204f1

Please sign in to comment.