Repository navigation
build(spider): Add Dockerfile and GitHub CI for CLP-tailored Spider Huntsman worker image. #2408
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
Merged
20001020ycx
merged 9 commits into
y-scope:main
from
20001020ycx:feat/2026-07-20-spider-worker-image
Jul 24, 2026
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
43797ad
feat(spider-worker): Add a CLP-tailored Spider worker image published…
20001020ycx e58ecc1
ci(spider-worker): Gate the Spider worker image build on the Jammy de…
20001020ycx c54b187
ci(spider-worker): Disable build provenance to publish a simple image…
20001020ycx 06d3ca4
Merge branch 'main' into feat/2026-07-20-spider-worker-image
junhaoliao a973b49
feat(spider-worker): Add log-converter to the CLP Spider worker image.
20001020ycx 258fd7b
Apply suggestions from code review
20001020ycx 0475ead
Merge branch 'main' into feat/2026-07-20-spider-worker-image
20001020ycx 583a7fe
chore: Re-trigger CI after upstream lint fix.
20001020ycx 4b839e1
Merge branch 'main' into feat/2026-07-20-spider-worker-image
junhaoliao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| ARG SPIDER_WORKER_IMAGE=ghcr.io/y-scope/spider/worker:main | ||
| FROM ${SPIDER_WORKER_IMAGE} | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| ARG SPIDER_TDL_PACKAGE_DIR=/opt/clp/lib/spider-tdl-packages | ||
|
20001020ycx marked this conversation as resolved.
Resolved
|
||
| ARG CLP_HOME=/opt/clp | ||
|
|
||
| USER root | ||
|
|
||
| RUN apt-get update \ | ||
| && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \ | ||
| ca-certificates \ | ||
| libcurl4 \ | ||
| libmariadb3 \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY --link ./build/rust-targets/release/libclp_tdl_package.so \ | ||
| ${SPIDER_TDL_PACKAGE_DIR}/clp/libclp.so | ||
| COPY --link ./build/core/clp-s ./build/core/indexer ${CLP_HOME}/bin/ | ||
|
|
||
| ENV SPIDER_TDL_PACKAGE_DIR=${SPIDER_TDL_PACKAGE_DIR} \ | ||
| CLP_HOME=${CLP_HOME} | ||
|
|
||
| USER spider-user | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -o errexit | ||
| set -o nounset | ||
| set -o pipefail | ||
|
|
||
| script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
| repo_root="${script_dir}/../../.." | ||
|
|
||
| . "${script_dir}/../utils.sh" | ||
|
|
||
| build_clp_image "clp-spider-worker" "${repo_root}" "${script_dir}/Dockerfile" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| remove_temp_file_and_prev_image() { | ||
| rm -f "$temp_iid_file" | ||
|
|
||
| if [[ -z "$new_image_id" ]]; then | ||
| rm -f "$iid_file" | ||
| elif [[ "$prev_image_id" == "$new_image_id" ]]; then | ||
| return | ||
| fi | ||
|
|
||
| [[ -z "$prev_image_id" ]] && return | ||
|
|
||
| docker image inspect "$prev_image_id" >/dev/null 2>&1 || return | ||
|
|
||
| echo "Removing previous image $prev_image_id." | ||
| docker image remove "$prev_image_id" || true | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| } | ||
|
|
||
| build_clp_image() { | ||
| local image_name="$1" | ||
| local repo_root="$2" | ||
| local dockerfile="$3" | ||
| shift 3 | ||
|
|
||
| iid_file="${repo_root}/build/${image_name}-image.id" | ||
|
|
||
| prev_image_id="" | ||
| if [[ -f "$iid_file" ]]; then | ||
| prev_image_id=$(<"$iid_file") | ||
| fi | ||
|
|
||
| temp_iid_file="$(mktemp)" | ||
| new_image_id="" | ||
| trap remove_temp_file_and_prev_image EXIT | ||
|
|
||
| build_cmd=( | ||
| docker build | ||
| --pull | ||
| --iidfile "$temp_iid_file" | ||
| "$repo_root" | ||
| --file "$dockerfile" | ||
| "$@" | ||
| ) | ||
|
|
||
| if command -v git >/dev/null && git -C "$repo_root" rev-parse --is-inside-work-tree >/dev/null; | ||
| then | ||
| build_cmd+=( | ||
| --label "org.opencontainers.image.revision=$(git -C "$repo_root" rev-parse HEAD)" | ||
| --label "org.opencontainers.image.source=$(git -C "$repo_root" remote get-url origin)" | ||
| ) | ||
| fi | ||
|
|
||
| "${build_cmd[@]}" | ||
|
|
||
| if [[ -s "$temp_iid_file" ]]; then | ||
| new_image_id="$(<"$temp_iid_file")" | ||
| echo "$new_image_id" > "$iid_file" | ||
|
|
||
| user="${USER:-$(whoami 2>/dev/null)}" \ | ||
| || user=$(id -un 2>/dev/null) \ | ||
| || user=$(id -u 2>/dev/null) \ | ||
| || user="unknown"; | ||
| short_id="${new_image_id#sha256:}" | ||
| short_id="${short_id:0:4}" | ||
| docker tag "$new_image_id" "${image_name}:dev-${user}-${short_id}" | ||
| fi | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.