mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 16:00:08 +01:00
ci: replace s3_upload wrapper with ci-fairy s3cp
Now that ci-fairy s3cp works, replace the s3_upload curl wrapper with ci-fairy s3cp command. Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34550>
This commit is contained in:
parent
4b3b3d4c70
commit
6c33b1e8c1
10 changed files with 14 additions and 30 deletions
|
|
@ -355,7 +355,7 @@ make git archive:
|
||||||
# compress the current folder
|
# compress the current folder
|
||||||
- tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
|
- tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
|
||||||
|
|
||||||
- s3_upload ../$CI_PROJECT_NAME.tar.gz "https://$S3_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/"
|
- ci-fairy s3cp --token-file "${S3_JWT_FILE}" ../$CI_PROJECT_NAME.tar.gz https://$S3_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
|
||||||
|
|
||||||
# Sanity checks of MR settings and commit logs
|
# Sanity checks of MR settings and commit logs
|
||||||
sanity:
|
sanity:
|
||||||
|
|
|
||||||
|
|
@ -230,7 +230,7 @@ cleanup
|
||||||
# upload artifacts (lava jobs)
|
# upload artifacts (lava jobs)
|
||||||
if [ -n "$S3_RESULTS_UPLOAD" ]; then
|
if [ -n "$S3_RESULTS_UPLOAD" ]; then
|
||||||
tar --zstd -cf results.tar.zst results/;
|
tar --zstd -cf results.tar.zst results/;
|
||||||
s3_upload results.tar.zst "https://${S3_RESULTS_UPLOAD}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" results.tar.zst https://"$S3_RESULTS_UPLOAD"/results.tar.zst
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We still need to echo the hwci: mesa message, as some scripts rely on it, such
|
# We still need to echo the hwci: mesa message, as some scripts rely on it, such
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ tar --zstd -cf "${ANDROID_LLVM_ARTIFACT_NAME}.tar.zst" "$LLVM_INSTALL_PREFIX"
|
||||||
# version does not change, and delete it.
|
# version does not change, and delete it.
|
||||||
# The file is not deleted for non-CI because it can be useful in local runs.
|
# The file is not deleted for non-CI because it can be useful in local runs.
|
||||||
if [ -n "$CI" ]; then
|
if [ -n "$CI" ]; then
|
||||||
s3_upload "${ANDROID_LLVM_ARTIFACT_NAME}.tar.zst" "https://${S3_HOST}/${S3_ANDROID_BUCKET}/${CI_PROJECT_PATH}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" "${ANDROID_LLVM_ARTIFACT_NAME}.tar.zst" "https://${S3_HOST}/${S3_ANDROID_BUCKET}/${CI_PROJECT_PATH}/${ANDROID_LLVM_ARTIFACT_NAME}.tar.zst"
|
||||||
rm "${ANDROID_LLVM_ARTIFACT_NAME}.tar.zst"
|
rm "${ANDROID_LLVM_ARTIFACT_NAME}.tar.zst"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,11 @@ if [ "${SKIP_UPDATE_FLUSTER_VECTORS}" != 1 ]; then
|
||||||
|
|
||||||
# Build fluster vectors archive and upload it
|
# Build fluster vectors archive and upload it
|
||||||
tar --zstd -cf "vectors.tar.zst" fluster/resources/
|
tar --zstd -cf "vectors.tar.zst" fluster/resources/
|
||||||
s3_upload vectors.tar.zst "https://${S3_PATH_FLUSTER}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" "vectors.tar.zst" \
|
||||||
|
"https://${S3_PATH_FLUSTER}/vectors.tar.zst"
|
||||||
|
|
||||||
touch /lava-files/done
|
touch /lava-files/done
|
||||||
s3_upload /lava-files/done "https://${S3_PATH_FLUSTER}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" /lava-files/done "https://${S3_PATH_FLUSTER}/done"
|
||||||
|
|
||||||
# Don't include the vectors in the rootfs
|
# Don't include the vectors in the rootfs
|
||||||
rm -fr fluster/resources/*
|
rm -fr fluster/resources/*
|
||||||
|
|
|
||||||
|
|
@ -422,7 +422,8 @@ popd
|
||||||
|
|
||||||
. .gitlab-ci/container/container_post_build.sh
|
. .gitlab-ci/container/container_post_build.sh
|
||||||
|
|
||||||
s3_upload /lava-files/"${ROOTFSTAR}" "https://${S3_PATH}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" /lava-files/"${ROOTFSTAR}" \
|
||||||
|
https://${S3_PATH}/"${ROOTFSTAR}"
|
||||||
|
|
||||||
touch /lava-files/done
|
touch /lava-files/done
|
||||||
s3_upload /lava-files/done "https://${S3_PATH}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" /lava-files/done https://${S3_PATH}/done
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ cp artifacts/ci-common/init-*.sh results/job-rootfs-overlay/
|
||||||
cp "$SCRIPTS_DIR"/setup-test-env.sh results/job-rootfs-overlay/
|
cp "$SCRIPTS_DIR"/setup-test-env.sh results/job-rootfs-overlay/
|
||||||
|
|
||||||
tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ .
|
tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ .
|
||||||
s3_upload job-rootfs-overlay.tar.gz "https://${JOB_ARTIFACTS_BASE}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" job-rootfs-overlay.tar.gz "https://${JOB_ROOTFS_OVERLAY_PATH}"
|
||||||
|
|
||||||
# Prepare env vars for upload.
|
# Prepare env vars for upload.
|
||||||
section_switch variables "Environment variables passed through to device:"
|
section_switch variables "Environment variables passed through to device:"
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,8 @@ replay_s3_upload_images() {
|
||||||
__DESTINATION_FILE_PATH="$__S3_TRACES_PREFIX/${line##*-}"
|
__DESTINATION_FILE_PATH="$__S3_TRACES_PREFIX/${line##*-}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
s3_upload "$RESULTS_DIR/$__PREFIX/$line" "https://${__S3_PATH}/${__DESTINATION_FILE_PATH%/*}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" "$RESULTS_DIR/$__PREFIX/$line" \
|
||||||
|
"https://${__S3_PATH}/${__DESTINATION_FILE_PATH}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ if [ -n "$S3_ARTIFACT_NAME" ]; then
|
||||||
# Pass needed files to the test stage
|
# Pass needed files to the test stage
|
||||||
S3_ARTIFACT_TAR="$S3_ARTIFACT_NAME.tar.zst"
|
S3_ARTIFACT_TAR="$S3_ARTIFACT_NAME.tar.zst"
|
||||||
tar c artifacts/ | zstd -o "${S3_ARTIFACT_TAR}"
|
tar c artifacts/ | zstd -o "${S3_ARTIFACT_TAR}"
|
||||||
s3_upload "${S3_ARTIFACT_TAR}" "https://${PIPELINE_ARTIFACTS_BASE}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" "${S3_ARTIFACT_TAR}" "https://${PIPELINE_ARTIFACTS_BASE}/${S3_ARTIFACT_TAR}"
|
||||||
rm "${S3_ARTIFACT_TAR}"
|
rm "${S3_ARTIFACT_TAR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ if [ -n "$S3_ARTIFACT_NAME" ]; then
|
||||||
# Pass needed files to the test stage
|
# Pass needed files to the test stage
|
||||||
S3_ARTIFACT_NAME="$S3_ARTIFACT_NAME.tar.zst"
|
S3_ARTIFACT_NAME="$S3_ARTIFACT_NAME.tar.zst"
|
||||||
zstd --quiet --threads ${FDO_CI_CONCURRENT:-0} artifacts/install.tar -o ${S3_ARTIFACT_NAME}
|
zstd --quiet --threads ${FDO_CI_CONCURRENT:-0} artifacts/install.tar -o ${S3_ARTIFACT_NAME}
|
||||||
s3_upload "${S3_ARTIFACT_NAME}" "https://${PIPELINE_ARTIFACTS_BASE}/"
|
ci-fairy s3cp --token-file "${S3_JWT_FILE}" ${S3_ARTIFACT_NAME} https://${PIPELINE_ARTIFACTS_BASE}/${S3_ARTIFACT_NAME}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
section_end prepare-artifacts
|
section_end prepare-artifacts
|
||||||
|
|
|
||||||
|
|
@ -285,25 +285,6 @@ export -f get_tag_file
|
||||||
|
|
||||||
# Structured tagging ------
|
# Structured tagging ------
|
||||||
|
|
||||||
s3_upload() {
|
|
||||||
x_off
|
|
||||||
local file=$1 s3_folder_url=$2
|
|
||||||
if [ ! -f "$file" ] || [[ "$s3_folder_url" != https://*/ ]]
|
|
||||||
then
|
|
||||||
echo "Error: s3_upload incorrect usage."
|
|
||||||
echo "Usage: s3_upload <file> <s3_folder_url>"
|
|
||||||
echo " - <file> must exist."
|
|
||||||
echo " - <s3_folder_url> must start with 'https://' and end with '/'."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
curl --fail --retry-all-errors --retry 4 --retry-delay 60 \
|
|
||||||
--header "Authorization: Bearer $(cat "${S3_JWT_FILE}")" \
|
|
||||||
-X PUT --form file=@"$file" \
|
|
||||||
"$s3_folder_url"
|
|
||||||
x_restore
|
|
||||||
}
|
|
||||||
export -f s3_upload
|
|
||||||
|
|
||||||
export -f error
|
export -f error
|
||||||
export -f trap_err
|
export -f trap_err
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue