Skip to content

Commit

Permalink
chore: update image name refs
Browse files Browse the repository at this point in the history
  • Loading branch information
mugdha-adhav committed Jan 22, 2024
1 parent 03636ae commit c30d5d6
Show file tree
Hide file tree
Showing 58 changed files with 168 additions and 174 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/images-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
env:
BASE_REPOSITORY: warm-metal/container-image-csi-driver
BASE_DEFAULT_BRANCH: main
BASE_IMAGE_NAME: warmmetal/csi-image
BASE_IMAGE_NAME: warmmetal/container-image-csi-driver
FORK_IMAGE_NAME: ghcr.io/${{ github.repository }}

permissions:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM docker.io/library/golang:1.20.4-alpine3.17 as builder
RUN apk add --no-cache btrfs-progs-dev lvm2-dev make build-base
WORKDIR /go/src/csi-driver-image
WORKDIR /go/src/container-image-csi-driver
COPY go.mod go.sum ./
RUN go mod download
COPY cmd ./cmd
Expand All @@ -10,10 +10,10 @@ RUN make build
RUN make install-util

FROM scratch as install-util
COPY --from=builder /go/src/csi-driver-image/_output/warm-metal-csi-image-install /
COPY --from=builder /go/src/container-image-csi-driver/_output/warm-metal-csi-image-install /

FROM alpine:3.17
RUN apk add --no-cache btrfs-progs-dev lvm2-dev
WORKDIR /
COPY --from=builder /go/src/csi-driver-image/_output/csi-image-plugin /usr/bin/
COPY --from=builder /go/src/container-image-csi-driver/_output/csi-image-plugin /usr/bin/
ENTRYPOINT ["csi-image-plugin"]
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[![containerd](https://github.com/warm-metal/csi-driver-image/actions/workflows/containerd.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/containerd.yaml)
[![docker-containerd](https://github.com/warm-metal/csi-driver-image/actions/workflows/docker-containerd.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/docker-containerd.yaml)
[![cri-o](https://github.com/warm-metal/csi-driver-image/actions/workflows/cri-o.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/cri-o.yaml)
[![containerd](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/containerd.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/containerd.yaml)
[![docker-containerd](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/docker-containerd.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/docker-containerd.yaml)
[![cri-o](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/cri-o.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/cri-o.yaml)
![Docker Pulls](https://img.shields.io/docker/pulls/warmmetal/csi-image?color=brightgreen&logo=docker&logoColor=lightgrey&labelColor=black)

# :construction_worker_man: :wrench: :construction: RENAMING THE REPOSITORY :construction: :wrench: :construction_worker_man:

We are currently in the process of [changing the repository name](https://github.com/warm-metal/csi-driver-image/issues/105). This alteration may potentially introduce issues during Continuous Integration (CI) runs or while building packages locally. If you encounter any problems, we encourage you to promptly create an issue so that we can assist you in resolving them.
We are currently in the process of [changing the repository name](https://github.com/warm-metal/container-image-csi-driver/issues/105). This alteration may potentially introduce issues during Continuous Integration (CI) runs or while building packages locally. If you encounter any problems, we encourage you to promptly create an issue so that we can assist you in resolving them.

### Note for Forked Repositories:
If you have forked this repository before January 21, 2024, we kindly request that you follow the steps outlined in the [GitHub documentation](https://docs.github.com/en/repositories/creating-and-managing-repositories/renaming-a-repository) to update your remote. This ensures that your fork remains synchronized with the latest changes and avoids any disruption to your workflow.
Expand All @@ -20,11 +20,11 @@ git remote set-head origin -a

We appreciate your cooperation and understanding as we work to improve our repository.

# csi-driver-image
# container-image-csi-driver (previously csi-driver-image)

This is a CSI driver for mounting images as PVs or ephemeral volumes.

It pulls images via CRI and shares the image store with the container runtime,
It pulls images via CRI and shares the image store with the container runtime,
then mounts images via the snapshot/storage service of the runtime.
**Read-Only** volumes of the same image share the same snapshot.
**Read-Write** volumes keep their own snapshot and changes until pod deletion.
Expand Down Expand Up @@ -55,7 +55,7 @@ The driver requires to mount various host paths for different container runtimes
So, I build a binary utility, `warm-metal-csi-image-install`, to reduce the installation complexity.
It supports kubernetes, microk8s and k3s clusters with container runtime **cri-o**, **containerd** or **docker**.
Users can run this utility on any nodes in their clusters to generate proper manifests to install the driver.
The download link is available on the [release page](https://github.com/warm-metal/csi-driver-image/releases).
The download link is available on the [release page](https://github.com/warm-metal/container-image-csi-driver/releases).

```shell script
# To print manifests
Expand All @@ -74,13 +74,13 @@ warm-metal-csi-image-install --pull-image-secret-for-daemonset=foo
warm-metal-csi-image-install --pull-image-secret-for-daemonset=foo --enable-daemon-image-credential-cache=false
```

You can found some installation manifests as samples in [examples](https://github.com/warm-metal/csi-driver-image/tree/master/sample).
You can found some installation manifests as samples in [examples](https://github.com/warm-metal/container-image-csi-driver/tree/master/sample).

#### Notice for docker
Until Docker migrates its [image and snapshot store](https://github.com/moby/moby/issues/38043) to containerd,
I recommend you use containerd instead. Otherwise, the driver can't use images managed by Docker daemon.

If your container runtime can't be migrated, you can enable the CRI plugin by clearing
If your container runtime can't be migrated, you can enable the CRI plugin by clearing
the containerd config file `/etc/containerd/config.toml`,
then restarting the containerd.

Expand All @@ -105,7 +105,7 @@ spec:
spec:
containers:
- name: ephemeral-volume
image: docker.io/warmmetal/csi-image-test:check-fs
image: docker.io/warmmetal/container-image-csi-driver-test:check-fs
env:
- name: TARGET
value: /target
Expand All @@ -120,7 +120,7 @@ spec:
# nodePublishSecretRef:
# name: "ImagePullSecret name in the same namespace"
volumeAttributes:
image: "docker.io/warmmetal/csi-image-test:simple-fs"
image: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
# # set pullAlways if you want to ignore local images
# pullAlways: "true"
backoffLimit: 0
Expand All @@ -143,7 +143,7 @@ spec:
persistentVolumeReclaimPolicy: Retain
csi:
driver: csi-image.warm-metal.tech
volumeHandle: "docker.io/warmmetal/csi-image-test:simple-fs"
volumeHandle: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
# nodePublishSecretRef:
# name: "name of the ImagePullSecret"
# namespace: "namespace of the secret"
Expand All @@ -152,14 +152,14 @@ spec:
# pullAlways: "true"
```

See all [examples](https://github.com/warm-metal/csi-driver-image/tree/master/sample).
See all [examples](https://github.com/warm-metal/container-image-csi-driver/tree/master/sample).

#### Private Image

There are several ways to configure credentials for private image pulling.
There are several ways to configure credentials for private image pulling.

If your clusters are in cloud, the credential provider are enabled automatically.
If your cloud provider provides a credential provider plugin instead, you can enable it by adding
If your cloud provider provides a credential provider plugin instead, you can enable it by adding
both `--image-credential-provider-config` and `--image-credential-provider-bin-dir` flags to the driver.
See [credential provider plugin](https://kubernetes.io/docs/tasks/kubelet-credential-provider/kubelet-credential-provider/).

Expand All @@ -176,7 +176,7 @@ then restart the driver daemon pod. Users can run `warm-metal-csi-image-install`
warm-metal-csi-image-install --pull-image-secret-for-daemonset=foo --pull-image-secret-for-daemonset=bar
```

If the secret works only for particular workloads, you can set via the `nodePublishSecretRef` attribute of ephemeral volumes.
If the secret works only for particular workloads, you can set via the `nodePublishSecretRef` attribute of ephemeral volumes.
See the above sample manifest, and notice that secrets and workloads must in the same namespace.
(Since version v0.5.1, pulling private images using the ImagePullSecrets which attached to workload service accounts is no longer supported for security reasons.)

Expand All @@ -186,11 +186,11 @@ You can also set the secret to a PV, then share the PV with multiple workloads.

### Sanity test

See [test/sanity](https://github.com/warm-metal/csi-driver-image/tree/master/test/sanity).
See [test/sanity](https://github.com/warm-metal/container-image-csi-driver/tree/master/test/sanity).

### E2E test

See [test/e2e](https://github.com/warm-metal/csi-driver-image/tree/master/test/e2e).
See [test/e2e](https://github.com/warm-metal/container-image-csi-driver/tree/master/test/e2e).

## Note on logging image size
Image sizes are logged after they finish pulling. We've noticed that for smaller images, usually under 1KiB, containerd may report an incorrect image size. An issue has been raised in the containerd github repository: https://github.com/containerd/containerd/issues/9641.
Expand Down
2 changes: 1 addition & 1 deletion charts/warm-metal-csi-driver/values-crio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ csiPlugin:
resources: {}
image:
tag: ""
repository: docker.io/warmmetal/csi-image
repository: docker.io/warmmetal/container-image-csi-driver
pullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion charts/warm-metal-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ csiPlugin:
resources: {}
image:
tag: ""
repository: docker.io/warmmetal/csi-image
repository: docker.io/warmmetal/container-image-csi-driver
pullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion cmd/plugin/controller_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/pkg/errors"
"github.com/warm-metal/csi-driver-image/pkg/watcher"
"github.com/warm-metal/container-image-csi-driver/pkg/watcher"
csicommon "github.com/warm-metal/csi-drivers/pkg/csi-common"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
17 changes: 8 additions & 9 deletions cmd/plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ import (
goflag "flag"
"fmt"
"net/url"
"time"

"github.com/container-storage-interface/spec/lib/go/csi"
flag "github.com/spf13/pflag"
"github.com/warm-metal/csi-driver-image/pkg/backend"
"github.com/warm-metal/csi-driver-image/pkg/backend/containerd"
"github.com/warm-metal/csi-driver-image/pkg/backend/crio"
"github.com/warm-metal/csi-driver-image/pkg/cri"
"github.com/warm-metal/csi-driver-image/pkg/metrics"
"github.com/warm-metal/csi-driver-image/pkg/secret"
"github.com/warm-metal/csi-driver-image/pkg/watcher"
"github.com/warm-metal/container-image-csi-driver/pkg/backend"
"github.com/warm-metal/container-image-csi-driver/pkg/backend/containerd"
"github.com/warm-metal/container-image-csi-driver/pkg/backend/crio"
"github.com/warm-metal/container-image-csi-driver/pkg/cri"
"github.com/warm-metal/container-image-csi-driver/pkg/metrics"
"github.com/warm-metal/container-image-csi-driver/pkg/secret"
"github.com/warm-metal/container-image-csi-driver/pkg/watcher"
csicommon "github.com/warm-metal/csi-drivers/pkg/csi-common"
"k8s.io/klog/v2"

"time"
)

const (
Expand Down
14 changes: 7 additions & 7 deletions cmd/plugin/node_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/containerd/containerd/reference/docker"
"github.com/google/uuid"
"github.com/warm-metal/csi-driver-image/pkg/backend"
"github.com/warm-metal/csi-driver-image/pkg/metrics"
"github.com/warm-metal/csi-driver-image/pkg/mountexecutor"
"github.com/warm-metal/csi-driver-image/pkg/mountstatus"
"github.com/warm-metal/csi-driver-image/pkg/pullexecutor"
"github.com/warm-metal/csi-driver-image/pkg/secret"
"github.com/warm-metal/container-image-csi-driver/pkg/backend"
"github.com/warm-metal/container-image-csi-driver/pkg/metrics"
"github.com/warm-metal/container-image-csi-driver/pkg/mountexecutor"
"github.com/warm-metal/container-image-csi-driver/pkg/mountstatus"
"github.com/warm-metal/container-image-csi-driver/pkg/pullexecutor"
"github.com/warm-metal/container-image-csi-driver/pkg/secret"
csicommon "github.com/warm-metal/csi-drivers/pkg/csi-common"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -101,7 +101,7 @@ func (n NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishV
return
}

if err = os.MkdirAll(req.TargetPath, 0755); err != nil {
if err = os.MkdirAll(req.TargetPath, 0o755); err != nil {
err = status.Error(codes.Internal, err.Error())
return
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/plugin/node_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (

"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/stretchr/testify/assert"
"github.com/warm-metal/csi-driver-image/pkg/backend"
"github.com/warm-metal/csi-driver-image/pkg/backend/containerd"
"github.com/warm-metal/csi-driver-image/pkg/cri"
"github.com/warm-metal/csi-driver-image/pkg/metrics"
"github.com/warm-metal/container-image-csi-driver/pkg/backend"
"github.com/warm-metal/container-image-csi-driver/pkg/backend/containerd"
"github.com/warm-metal/container-image-csi-driver/pkg/cri"
"github.com/warm-metal/container-image-csi-driver/pkg/metrics"
csicommon "github.com/warm-metal/csi-drivers/pkg/csi-common"
"google.golang.org/grpc"
"k8s.io/apimachinery/pkg/util/wait"
Expand Down
20 changes: 10 additions & 10 deletions docs/automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
There are a few [GitHub Workflows](https://docs.github.com/en/actions/using-workflows/about-workflows#about-workflows) that run on this repository.

## Build
- [![Create and publish the container image.](https://github.com/warm-metal/csi-driver-image/actions/workflows/images-build-and-push.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/images-build-and-push.yaml)
- On the main repository - `warm-metal/csi-driver-image`, builds and pushes the container image to Docker Hub [`warmmetal/csi-image`](https://hub.docker.com/r/warmmetal/csi-image)
- [![Create and publish the container image.](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/images-build-and-push.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/images-build-and-push.yaml)
- On the main repository - `warm-metal/container-image-csi-driver`, builds and pushes the container image to Docker Hub [`warmmetal/csi-image`](https://hub.docker.com/r/warmmetal/csi-image)
- On any forks, builds and pushes the container image to `ghcr.io/<repository-name>`

## Tests

- [![backward-compatibility-5mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/backward-compatibility.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/backward-compatibility.yaml)
- [![containerd-11mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/containerd.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/containerd.yaml)
- [![cri-o-10mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/cri-o.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/cri-o.yaml)
- [![restart-ds-containerd-5mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/restart-ds-containerd.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/restart-ds-containerd.yaml)
- [![restart-ds-crio-8mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/restart-ds-crio.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/restart-ds-crio.yaml)
- [![test-metrics-5m](https://github.com/warm-metal/csi-driver-image/actions/workflows/metrics.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/metrics.yaml)
- [![backward-compatibility-5mins](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/backward-compatibility.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/backward-compatibility.yaml)
- [![containerd-11mins](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/containerd.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/containerd.yaml)
- [![cri-o-10mins](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/cri-o.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/cri-o.yaml)
- [![restart-ds-containerd-5mins](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/restart-ds-containerd.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/restart-ds-containerd.yaml)
- [![restart-ds-crio-8mins](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/restart-ds-crio.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/restart-ds-crio.yaml)
- [![test-metrics-5m](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/metrics.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/metrics.yaml)

## Maintenance

- [![Delete old container images](https://github.com/warm-metal/csi-driver-image/actions/workflows/images-cleanup.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/images-cleanup.yaml)
- [![Delete old container images](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/images-cleanup.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/images-cleanup.yaml)
- Deletes all `ghcr.io/<repository-name>` image tags, expect `latest` or any semver tags. This workflow will run on forks only.
- [![Close stale issues and PRs](https://github.com/warm-metal/csi-driver-image/actions/workflows/stale.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/stale.yaml)
- [![Close stale issues and PRs](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/stale.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/stale.yaml)
- [Create a repository variable](https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository) `DEBUG_ONLY` with value `true` to run the action in dry-run mode.
- Marks issues or PRs as stale after 30 days and closes them after 7 days, except those labeled with any of of the following
- `awaiting-approval`
Expand Down
Loading

0 comments on commit c30d5d6

Please sign in to comment.