include missing PATH for iscsiadm chroot, update PATH for other docker tools, build/push windows images
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
b81a47d126
commit
81a42d789f
|
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "$DOCKER_PASSWORD" | docker login docker.io -u "$DOCKER_USERNAME" --password-stdin
|
||||
echo "$GHCR_PASSWORD" | docker login ghcr.io -u "$GHCR_USERNAME" --password-stdin
|
||||
|
||||
export DOCKER_ORG="democraticcsi"
|
||||
export DOCKER_PROJECT="democratic-csi"
|
||||
export DOCKER_REPO="docker.io/${DOCKER_ORG}/${DOCKER_PROJECT}"
|
||||
|
||||
export GHCR_ORG="democratic-csi"
|
||||
export GHCR_PROJECT="democratic-csi"
|
||||
export GHCR_REPO="ghcr.io/${GHCR_ORG}/${GHCR_PROJECT}"
|
||||
|
||||
export MANIFEST_NAME="democratic-csi-combined:${IMAGE_TAG}"
|
||||
|
||||
if [[ -n "${IMAGE_TAG}" ]]; then
|
||||
# create local manifest to work with
|
||||
buildah manifest rm "${MANIFEST_NAME}" || true
|
||||
buildah manifest create "${MANIFEST_NAME}"
|
||||
|
||||
# all all the existing linux data to the manifest
|
||||
buildah manifest add "${MANIFEST_NAME}" --all "${DOCKER_REPO}:${IMAGE_TAG}"
|
||||
buildah manifest inspect "${MANIFEST_NAME}"
|
||||
|
||||
# import pre-built images
|
||||
buildah pull docker-archive:democratic-csi-windows-ltsc2019.tar
|
||||
buildah pull docker-archive:democratic-csi-windows-ltsc2022.tar
|
||||
|
||||
# add pre-built images to manifest
|
||||
buildah manifest add "${MANIFEST_NAME}" democratic-csi-windows:${GITHUB_RUN_ID}-ltsc2019
|
||||
buildah manifest add "${MANIFEST_NAME}" democratic-csi-windows:${GITHUB_RUN_ID}-ltsc2022
|
||||
buildah manifest inspect "${MANIFEST_NAME}"
|
||||
|
||||
# push manifest
|
||||
buildah manifest push --all "${MANIFEST_NAME}" docker://${DOCKER_REPO}:${IMAGE_TAG}
|
||||
buildah manifest push --all "${MANIFEST_NAME}" docker://${GHCR_REPO}:${IMAGE_TAG}
|
||||
|
||||
# cleanup
|
||||
buildah manifest rm "${MANIFEST_NAME}" || true
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
|
@ -11,20 +11,8 @@ export GHCR_ORG="democratic-csi"
|
|||
export GHCR_PROJECT="democratic-csi"
|
||||
export GHCR_REPO="ghcr.io/${GHCR_ORG}/${GHCR_PROJECT}"
|
||||
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
export GIT_TAG=${GITHUB_REF#refs/tags/}
|
||||
else
|
||||
export GIT_BRANCH=${GITHUB_REF#refs/heads/}
|
||||
fi
|
||||
|
||||
if [[ -n "${GIT_TAG}" ]]; then
|
||||
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:${GIT_TAG} -t ${GHCR_REPO}:${GIT_TAG} .
|
||||
elif [[ -n "${GIT_BRANCH}" ]]; then
|
||||
if [[ "${GIT_BRANCH}" == "master" ]]; then
|
||||
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:latest -t ${GHCR_REPO}:latest .
|
||||
else
|
||||
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:${GIT_BRANCH} -t ${GHCR_REPO}:${GIT_BRANCH} .
|
||||
fi
|
||||
if [[ -n "${IMAGE_TAG}" ]]; then
|
||||
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:${IMAGE_TAG} -t ${GHCR_REPO}:${IMAGE_TAG} .
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -367,8 +367,33 @@ jobs:
|
|||
SERVER_PASSWORD: ${{ secrets.SANITY_ZFS_GENERIC_PASSWORD }}
|
||||
CSI_SANITY_FOCUS: "Node Service"
|
||||
|
||||
determine-image-tag:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
tag: ${{ steps.tag.outputs.tag }}
|
||||
steps:
|
||||
- id: tag
|
||||
run: |
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
export GIT_TAG=${GITHUB_REF#refs/tags/}
|
||||
else
|
||||
export GIT_BRANCH=${GITHUB_REF#refs/heads/}
|
||||
fi
|
||||
if [[ -n "${GIT_TAG}" ]]; then
|
||||
echo "::set-output name=tag::${GIT_TAG}"
|
||||
elif [[ -n "${GIT_BRANCH}" ]]; then
|
||||
if [[ "${GIT_BRANCH}" == "master" ]]; then
|
||||
echo "::set-output name=tag::latest"
|
||||
else
|
||||
echo "::set-output name=tag::${GIT_BRANCH}"
|
||||
fi
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
build-docker-linux:
|
||||
needs:
|
||||
- determine-image-tag
|
||||
- csi-sanity-synology-dsm6
|
||||
- csi-sanity-synology-dsm7
|
||||
- csi-sanity-truenas-scale-22_02
|
||||
|
|
@ -403,6 +428,7 @@ jobs:
|
|||
GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }}
|
||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||
DOCKER_BUILD_PLATFORM: linux/amd64,linux/arm64,linux/arm/v7,linux/s390x,linux/ppc64le
|
||||
IMAGE_TAG: ${{needs.determine-image-tag.outputs.tag}}
|
||||
|
||||
build-docker-windows:
|
||||
needs:
|
||||
|
|
@ -421,24 +447,53 @@ jobs:
|
|||
matrix:
|
||||
os: [windows-2019, windows-2022]
|
||||
include:
|
||||
- os: windows-2019
|
||||
base_tag: ltsc2019
|
||||
file: Dockerfile.Windows
|
||||
- os: windows-2022
|
||||
base_tag: ltsc2022
|
||||
file: Dockerfile.Windows
|
||||
- os: windows-2019
|
||||
base_tag: ltsc2019
|
||||
file: Dockerfile.Windows
|
||||
- os: windows-2022
|
||||
base_tag: ltsc2022
|
||||
file: Dockerfile.Windows
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: docker build
|
||||
shell: bash
|
||||
run: |
|
||||
docker info
|
||||
docker build --pull -f ${{ matrix.file }} --build-arg BASE_TAG=${{ matrix.base_tag }} -t windows:${{ matrix.base_tag }} .
|
||||
docker build --pull -f ${{ matrix.file }} --build-arg BASE_TAG=${{ matrix.base_tag }} -t democratic-csi-windows:${GITHUB_RUN_ID}-${{ matrix.base_tag }} .
|
||||
docker inspect windows:${{ matrix.base_tag }}
|
||||
docker save windows:${{ matrix.base_tag }} -o windows-${{ matrix.base_tag }}.tar
|
||||
docker save democratic-csi-windows:${GITHUB_RUN_ID}-${{ matrix.base_tag }} -o democratic-csi-windows-${{ matrix.base_tag }}.tar
|
||||
- name: upload image tar
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: windows-${{ matrix.base_tag }}.tar
|
||||
path: windows-${{ matrix.base_tag }}.tar
|
||||
name: democratic-csi-windows-${{ matrix.base_tag }}.tar
|
||||
path: democratic-csi-windows-${{ matrix.base_tag }}.tar
|
||||
retention-days: 7
|
||||
|
||||
push-docker-windows:
|
||||
needs:
|
||||
- build-docker-linux
|
||||
- build-docker-windows
|
||||
- determine-image-tag
|
||||
runs-on:
|
||||
- self-hosted
|
||||
- buildah
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: democratic-csi-windows-ltsc2019.tar
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: democratic-csi-windows-ltsc2022.tar
|
||||
- name: push windows images with buildah
|
||||
run: |
|
||||
#.github/bin/install_latest_buildah.sh
|
||||
buildah version
|
||||
.github/bin/docker-release-windows.sh
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
|
||||
GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }}
|
||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||
IMAGE_TAG: ${{needs.determine-image-tag.outputs.tag}}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
# https://engineering.docker.com/2019/07/road-to-containing-iscsi/
|
||||
|
||||
chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin" iscsiadm "${@:1}"
|
||||
chroot /host /usr/bin/env -i PATH="/usr/sbin:/usr/bin:/sbin:/bin" iscsiadm "${@:1}"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ while getopts "t:" opt; do
|
|||
done
|
||||
|
||||
if [[ ${USE_HOST_MOUNT_TOOLS} -eq 1 ]]; then
|
||||
chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" mount "${@:1}"
|
||||
chroot /host /usr/bin/env -i PATH="/usr/sbin:/usr/bin:/sbin:/bin" mount "${@:1}"
|
||||
else
|
||||
/usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" mount "${@:1}"
|
||||
/usr/bin/env -i PATH="/usr/sbin:/usr/bin:/sbin:/bin" mount "${@:1}"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/sbin:/usr/bin" multipath "${@:1}"
|
||||
chroot /host /usr/bin/env -i PATH="/usr/sbin:/usr/bin:/sbin:/bin" multipath "${@:1}"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" oneclient "${@:1}"
|
||||
chroot /host /usr/bin/env -i PATH="/usr/sbin:/usr/bin:/sbin:/bin" oneclient "${@:1}"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ while getopts "t:" opt; do
|
|||
done
|
||||
|
||||
if [[ ${USE_HOST_MOUNT_TOOLS} -eq 1 ]]; then
|
||||
chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" umount "${@:1}"
|
||||
chroot /host /usr/bin/env -i PATH="/usr/sbin:/usr/bin:/sbin:/bin" umount "${@:1}"
|
||||
else
|
||||
/usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" umount "${@:1}"
|
||||
/usr/bin/env -i PATH="/usr/sbin:/usr/bin:/sbin:/bin" umount "${@:1}"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" zfs "${@:1}"
|
||||
chroot /host /usr/bin/env -i PATH="/usr/sbin:/usr/bin:/sbin:/bin" zfs "${@:1}"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" zpool "${@:1}"
|
||||
chroot /host /usr/bin/env -i PATH="/usr/sbin:/usr/bin:/sbin:/bin" zpool "${@:1}"
|
||||
|
|
|
|||
|
|
@ -1128,6 +1128,14 @@ class CsiBaseDriver {
|
|||
}
|
||||
}
|
||||
|
||||
switch (fs_type) {
|
||||
case "xfs":
|
||||
// https://github.com/democratic-csi/democratic-csi/issues/191
|
||||
// to avoid issues with cloned volumes
|
||||
mount_flags.push(`nouuid`);
|
||||
break;
|
||||
}
|
||||
|
||||
await mount.mount(
|
||||
device,
|
||||
staging_target_path,
|
||||
|
|
|
|||
Loading…
Reference in New Issue