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

add ee_pkg_url input in image ci #1096

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 12 additions & 1 deletion .github/workflows/juicefs-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: 'ce juicefs version for image build'
required: false
type: string
ee_pkg_url:
description: 'ee juicefs pkg url for image build'
required: false
type: string
schedule:
- cron: "0 0 * * *"

Expand Down Expand Up @@ -164,9 +168,15 @@ jobs:
run: docker login --username chnliyong --password ${PASSWORD}
- name: check latest tag
continue-on-error: true
env:
ee_pkg_url: ${{ inputs.ee_pkg_url }}
run: |
set +e
curl -sSL https://static.juicefs.com/release/bin_pkgs/latest_stable_full.tar.gz | tar -xz
url=${{ env.ee_pkg_url }}
if [ -z "$ee_pkg_url" ]; then
url="https://static.juicefs.com/release/bin_pkgs/latest_stable_full.tar.gz"
fi
curl -sSL $url | tar -xz
version=$(grep -oP 'mount_version=\K.*' version.ini)
hash=$(./Linux/mount version | awk -F '[()]' '{print $2}' | awk '{print $NF}')
JUICEFS_EE_LATEST_VERSION=$version-$hash
Expand All @@ -189,6 +199,7 @@ jobs:
IMAGE_TAG: ee-${{ env.JUICEFS_EE_LATEST_VERSION }}
ACR_TOKEN: ${{ secrets.ACR_TOKEN }}
ACR_USERNAME: ${{ secrets.ACR_USERNAME }}
JFSPKGURL: ${{ inputs.ee_pkg_url }}
run: |
mount_image_exist=${{ env.MOUNT_IMAGE_EXIST }}
export DOCKER_CLI_EXPERIMENTAL=enabled
Expand Down
2 changes: 2 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ IMAGE_VERSION_ANNOTATED=$(IMAGE):$(VERSION)-juicefs$(shell docker run --entrypoi
JUICEFS_CE_LATEST_VERSION=$(shell curl -fsSL https://api.github.com/repos/juicedata/juicefs/releases/latest | grep tag_name | grep -oE 'v[0-9]+\.[0-9][0-9]*(\.[0-9]+(-[0-9a-z]+)?)?')
JUICEFS_EE_LATEST_VERSION=$(shell curl -sSL https://juicefs.com/static/juicefs -o juicefs-ee && chmod +x juicefs-ee && ./juicefs-ee version | cut -d' ' -f3)
JFS_CHAN=${JFSCHAN}
JFS_PKG_URL=${JFSPKGURL}
JUICEFS_REPO_URL?=https://github.com/juicedata/juicefs
JUICEFS_REPO_REF?=$(JUICEFS_CE_LATEST_VERSION)
MOUNT_TAG=${MOUNTTAG}
Expand Down Expand Up @@ -135,6 +136,7 @@ ee-image:
ee-image-buildx:
docker buildx build -f ee.juicefs.Dockerfile -t $(REGISTRY)/$(JUICEFS_IMAGE):$(EE_VERSION) \
--build-arg JFSCHAN=$(JFS_CHAN) \
--build-arg JFS_PKG_URL=$(JFS_PKG_URL) \
--platform linux/amd64,linux/arm64 . --push

.PHONY: ee-image-4.0-buildx
Expand Down
3 changes: 2 additions & 1 deletion docker/ee.juicefs.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ARG JFSCHAN
WORKDIR /app

ARG TARGETARCH
ARG JFS_PKG_URL=https://static.juicefs.com/release/bin_pkgs/latest_stable_full.tar.gz
ENV JUICEFS_CLI=/usr/bin/juicefs
ENV JFS_MOUNT_PATH=/usr/local/juicefs/mount/jfsmount
ENV JFSCHAN=${JFSCHAN}
Expand All @@ -37,7 +38,7 @@ RUN apt-get update && apt-get install -y curl fuse procps iputils-ping strace ip

RUN jfs_mount_path=${JFS_MOUNT_PATH} && \
bash -c "if [[ '${JFSCHAN}' == beta ]]; then curl -sSL https://static.juicefs.com/release/bin_pkgs/beta_full.tar.gz | tar -xz; jfs_mount_path=${JFS_MOUNT_PATH}.beta; \
else curl -sSL https://static.juicefs.com/release/bin_pkgs/latest_stable_full.tar.gz | tar -xz; fi;" && \
else curl -sSL ${JFS_PKG_URL} | tar -xz; fi;" && \
bash -c "mkdir -p /usr/local/juicefs/mount; if [[ '${TARGETARCH}' == amd64 ]]; then cp Linux/mount.ceph $jfs_mount_path; else cp Linux/mount.aarch64 $jfs_mount_path; fi;" && \
chmod +x ${jfs_mount_path} && cp juicefs.py ${JUICEFS_CLI} && chmod +x ${JUICEFS_CLI}

Expand Down
Loading