Skip to content

Commit 73cf6e7

Browse files
authored
Merge branch 'main' into aws-hostpath
2 parents 1797113 + a56d880 commit 73cf6e7

34 files changed

Lines changed: 265 additions & 260 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/actions/clp-build-runtime-image/action.yaml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ inputs:
2121
description: "Platform VERSION_ID / VERSION_CODENAME of the container
2222
(e.g. jammy, focal, etc.)"
2323
required: false
24+
arch:
25+
description: "Target architecture (amd64 or arm64)"
26+
default: "amd64"
27+
required: false
2428

2529
runs:
2630
using: "composite"
@@ -29,7 +33,7 @@ runs:
2933
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2"
3034

3135
- name: "Login to Image Registry"
32-
uses: "docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772"
36+
uses: "docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121" # v4.1.0
3337
with:
3438
registry: "${{inputs.image_registry}}"
3539
username: "${{inputs.image_registry_username}}"
@@ -61,13 +65,32 @@ runs:
6165
with:
6266
images: "${{inputs.image_registry}}/${{steps.sanitization.outputs.REPOSITORY}}\
6367
/${{steps.compute-meta.outputs.IMAGE_NAME}}"
68+
flavor: |
69+
suffix=-${{inputs.arch}}
70+
71+
- name: "Map arch to Docker platform"
72+
id: "map-arch"
73+
shell: "bash"
74+
run: |
75+
if [ "${{inputs.arch}}" = "arm64" ]; then
76+
echo "platform=linux/arm64" >> "$GITHUB_OUTPUT"
77+
elif [ "${{inputs.arch}}" = "amd64" ]; then
78+
echo "platform=linux/amd64" >> "$GITHUB_OUTPUT"
79+
else
80+
echo >&2 "ERROR: Unsupported arch '${{inputs.arch}}'. Must be 'amd64' or 'arm64'."
81+
exit 1
82+
fi
6483
6584
- name: "Build and Push"
6685
if: "github.event_name != 'pull_request' && github.ref == 'refs/heads/main'"
6786
uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4"
6887
with:
6988
context: "./"
7089
file: "${{steps.compute-meta.outputs.DOCKERFILE}}"
90+
platforms: "${{steps.map-arch.outputs.platform}}"
91+
# Disable provenance to create a simple image instead of a manifest list.
92+
# This allows `docker manifest create` to combine the per-arch images later.
93+
provenance: false
7194
push: true
7295
tags: "${{steps.extract-gh-meta.outputs.tags}}"
7396
labels: "${{steps.extract-gh-meta.outputs.labels}}"

.github/workflows/clp-artifact-build.yaml

Lines changed: 100 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ jobs:
250250
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
251251
token: "${{secrets.GITHUB_TOKEN}}"
252252

253-
ubuntu-jammy-deps-image:
254-
name: "ubuntu-jammy-deps-image"
253+
ubuntu-jammy-x86_64-deps-image:
254+
name: "ubuntu-jammy-x86_64-deps-image"
255255
if: "needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'true'"
256256
needs: "filter-relevant-changes"
257257
runs-on: *runner
@@ -276,6 +276,35 @@ jobs:
276276
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
277277
token: "${{secrets.GITHUB_TOKEN}}"
278278

279+
ubuntu-jammy-aarch64-deps-image:
280+
name: "ubuntu-jammy-aarch64-deps-image"
281+
if: >-
282+
needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'true'
283+
&& github.event_name != 'pull_request'
284+
&& github.ref == 'refs/heads/main'
285+
needs: "filter-relevant-changes"
286+
runs-on: "ubuntu-24.04-arm"
287+
steps:
288+
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
289+
with:
290+
submodules: "recursive"
291+
292+
- name: "Work around actions/runner-images/issues/6775"
293+
run: "chown $(id -u):$(id -g) -R ."
294+
shell: "bash"
295+
296+
- uses: "./.github/actions/clp-core-build-containers"
297+
env:
298+
OS_NAME: "ubuntu-jammy"
299+
with:
300+
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX_AARCH64}}${{env.OS_NAME}}"
301+
docker_context: "components/core"
302+
docker_file: "components/core/tools/docker-images/clp-env-base-${{env.OS_NAME}}\
303+
/Dockerfile"
304+
push_deps_image: >-
305+
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
306+
token: "${{secrets.GITHUB_TOKEN}}"
307+
279308
centos-stream-9-binaries:
280309
# Run if the ancestor jobs succeeded OR they were skipped and clp was changed.
281310
if: >-
@@ -455,7 +484,7 @@ jobs:
455484
|| (!cancelled() && !failure() && needs.filter-relevant-changes.outputs.clp_changed == 'true')
456485
needs:
457486
- "filter-relevant-changes"
458-
- "ubuntu-jammy-deps-image"
487+
- "ubuntu-jammy-x86_64-deps-image"
459488
strategy:
460489
matrix:
461490
include:
@@ -539,7 +568,7 @@ jobs:
539568
tar xf clp.tar
540569
rm clp.tar
541570
542-
- uses: "docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772"
571+
- uses: "docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121" # v4.1.0
543572
with:
544573
registry: "ghcr.io"
545574
username: "${{github.actor}}"
@@ -580,7 +609,7 @@ jobs:
580609
|| (!cancelled() && !failure() && needs.filter-relevant-changes.outputs.clp_changed == 'true')
581610
needs:
582611
- "filter-relevant-changes"
583-
- "ubuntu-jammy-deps-image"
612+
- "ubuntu-jammy-x86_64-deps-image"
584613
runs-on: *runner
585614
steps:
586615
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
@@ -649,16 +678,35 @@ jobs:
649678
)}}
650679
651680
package-image:
652-
name: "package-image"
681+
name: "package-image-${{matrix.arch}}"
682+
# NOTE: The aarch64 job is skipped on PRs, so we accept both 'success' and 'skipped'.
653683
if: >-
654684
!cancelled() && !failure() && (
655685
needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'false' ||
656-
needs.ubuntu-jammy-deps-image.result == 'success'
686+
(needs.ubuntu-jammy-x86_64-deps-image.result == 'success'
687+
&& (needs.ubuntu-jammy-aarch64-deps-image.result == 'success'
688+
|| needs.ubuntu-jammy-aarch64-deps-image.result == 'skipped'))
657689
)
658690
needs:
659691
- "filter-relevant-changes"
660-
- "ubuntu-jammy-deps-image"
661-
runs-on: *runner
692+
- "ubuntu-jammy-x86_64-deps-image"
693+
- "ubuntu-jammy-aarch64-deps-image"
694+
strategy:
695+
matrix:
696+
# Only build arm64 images on push to main to save CI resources on PRs.
697+
arch: >-
698+
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
699+
&& fromJSON('["amd64", "arm64"]') || fromJSON('["amd64"]')}}
700+
runs-on: >-
701+
${{
702+
matrix.arch == 'amd64'
703+
&& (github.repository_owner == 'y-scope'
704+
&& fromJSON('["self-hosted", "x64", "ubuntu-noble"]')
705+
|| 'ubuntu-24.04')
706+
|| (github.repository_owner == 'y-scope'
707+
&& fromJSON('["self-hosted", "arm64", "ubuntu-noble"]')
708+
|| 'ubuntu-24.04-arm')
709+
}}
662710
steps:
663711
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
664712
with:
@@ -673,7 +721,10 @@ jobs:
673721
env:
674722
OS_NAME: "ubuntu-jammy"
675723
with:
676-
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX_X86}}${{env.OS_NAME}}"
724+
image_name: >-
725+
${{format('{0}ubuntu-jammy',
726+
matrix.arch == 'amd64' && env.DEPS_IMAGE_NAME_PREFIX_X86
727+
|| env.DEPS_IMAGE_NAME_PREFIX_AARCH64)}}
677728
use_published_image: >-
678729
${{needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'false'
679730
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
@@ -687,3 +738,42 @@ jobs:
687738
image_registry: "ghcr.io"
688739
image_registry_username: "${{github.actor}}"
689740
image_registry_password: "${{secrets.GITHUB_TOKEN}}"
741+
arch: "${{matrix.arch}}"
742+
743+
package-image-multiarch-manifest:
744+
name: "package-image-multiarch-manifest"
745+
if: >-
746+
github.event_name != 'pull_request'
747+
&& github.ref == 'refs/heads/main'
748+
&& needs.package-image.result == 'success'
749+
needs: "package-image"
750+
runs-on: *runner
751+
steps:
752+
- name: "Login to Image Registry"
753+
uses: "docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121" # v4.1.0
754+
with:
755+
registry: "ghcr.io"
756+
username: "${{github.actor}}"
757+
password: "${{secrets.GITHUB_TOKEN}}"
758+
759+
- name: "Sanitize Repository Name"
760+
id: "sanitization"
761+
shell: "bash"
762+
run: |
763+
echo "REPOSITORY=$(echo '${{github.repository}}' | tr '[:upper:]' '[:lower:]')" \
764+
>> "$GITHUB_OUTPUT"
765+
766+
- name: "Create and Push Multi-arch Manifest"
767+
shell: "bash"
768+
run: |
769+
image_base="ghcr.io/${{steps.sanitization.outputs.REPOSITORY}}/clp-package"
770+
tags=("${{github.ref_name}}")
771+
if [ "${{github.event_name}}" = "schedule" ]; then
772+
tags+=("nightly")
773+
fi
774+
for tag in "${tags[@]}"; do
775+
docker manifest create "${image_base}:${tag}" \
776+
"${image_base}:${tag}-amd64" \
777+
"${image_base}:${tag}-arm64"
778+
docker manifest push "${image_base}:${tag}"
779+
done

components/clp-package-utils/clp_package_utils/controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ def _set_up_env_for_database_bundling(self) -> EnvVarsDict:
168168
# Runtime config
169169
env_vars |= {
170170
"CLP_DB_CONTAINER_IMAGE_REF": (
171-
"mysql:8.0.23"
171+
"mysql:8.0.46"
172172
if self._clp_config.database.type == DatabaseEngine.MYSQL
173-
else "mariadb:10-jammy"
173+
else "mariadb:10.11.16"
174174
),
175175
}
176176

components/clp-rust-utils/src/job_config/ingestion.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ pub mod s3 {
2828
Self::S3Scanner(config) => &config.base,
2929
}
3030
}
31+
32+
#[must_use]
33+
pub const fn as_buffer_config(&self) -> &BufferConfig {
34+
match self {
35+
Self::SqsListener(config) => &config.buffer_config,
36+
Self::S3Scanner(config) => &config.buffer_config,
37+
}
38+
}
3139
}
3240

3341
/// Base configuration for ingesting logs from S3.
@@ -65,10 +73,6 @@ pub mod s3 {
6573
/// Whether to treat the ingested objects as unstructured logs. Defaults to `false`.
6674
#[serde(default = "default_unstructured")]
6775
pub unstructured: bool,
68-
69-
/// Per-job ingestion buffer config.
70-
#[serde(default)]
71-
pub buffer_config: BufferConfig,
7276
}
7377

7478
/// Configuration for a SQS listener job.
@@ -77,6 +81,10 @@ pub mod s3 {
7781
#[serde(flatten)]
7882
pub base: BaseConfig,
7983

84+
/// Per-job ingestion buffer config.
85+
#[serde(default)]
86+
pub buffer_config: BufferConfig,
87+
8088
/// The SQS queue URL to poll for S3 event notifications. The given queue must be dedicated
8189
/// to this ingestion job.
8290
#[schema(value_type = String, min_length = 1)]
@@ -153,6 +161,10 @@ pub mod s3 {
153161
#[serde(flatten)]
154162
pub base: BaseConfig,
155163

164+
/// Per-job ingestion buffer config.
165+
#[serde(default)]
166+
pub buffer_config: BufferConfig,
167+
156168
/// The scan interval in seconds. Defaults to 30 seconds.
157169
#[serde(default = "default_scanning_interval_sec")]
158170
pub scanning_interval_sec: u32,

components/job-orchestration/job_orchestration/garbage_collector/archive_garbage_collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ async def archive_garbage_collector(clp_config: ClpConfig) -> None:
199199
validate_storage_type(archive_output_config, storage_engine)
200200

201201
sweep_interval_secs = clp_config.garbage_collector.sweep_interval.archive * MIN_TO_SECONDS
202-
recovery_file = clp_config.logs_directory / f"{ARCHIVE_GARBAGE_COLLECTOR_NAME}.tmp"
202+
recovery_file = clp_config.tmp_directory / f"{ARCHIVE_GARBAGE_COLLECTOR_NAME}.tmp"
203203

204204
logger.info(f"{ARCHIVE_GARBAGE_COLLECTOR_NAME} started.")
205205
try:

components/log-ingestor/src/ingestion_job_manager/clp_ingestion.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ impl ClpDbIngestionConnector {
422422
db_pool: self.db_pool.clone(),
423423
};
424424
let base_config = config.as_base_config();
425+
let buffer_config = config.as_buffer_config();
425426

426427
let submitter = CompressionJobSubmitter::new(
427428
compression_state.clone(),
@@ -431,9 +432,9 @@ impl ClpDbIngestionConnector {
431432
);
432433

433434
let listener = Listener::spawn(
434-
Buffer::new(submitter, base_config.buffer_config.flush_threshold_bytes),
435-
Duration::from_secs(base_config.buffer_config.timeout_sec),
436-
base_config.buffer_config.channel_capacity,
435+
Buffer::new(submitter, buffer_config.flush_threshold_bytes),
436+
Duration::from_secs(buffer_config.timeout_sec),
437+
buffer_config.channel_capacity,
437438
)?;
438439
let ingestion_state = ClpIngestionState {
439440
job_id,

components/log-ingestor/tests/test_ingestion_job.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ async fn test_sqs_listener() -> Result<()> {
270270
dataset: None,
271271
timestamp_key: None,
272272
unstructured: false,
273-
buffer_config: BufferConfig::default(),
274273
},
274+
buffer_config: BufferConfig::default(),
275275
},
276276
)
277277
.await
@@ -312,8 +312,8 @@ async fn test_s3_scanner() -> Result<()> {
312312
dataset: None,
313313
timestamp_key: None,
314314
unstructured: false,
315-
buffer_config: BufferConfig::default(),
316315
},
316+
buffer_config: BufferConfig::default(),
317317
scanning_interval_sec: 1,
318318
start_after: None,
319319
};

components/webui/client/src/pages/LogViewerLoadingPage/QueryStatus.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ const QueryStatus = () => {
9090
setQueryState(QUERY_LOADING_STATE.LOADING);
9191

9292
const innerLogEventNum = parseResult.logEventIdx - data.begin_msg_ix + 1;
93-
window.location.href = `/log-viewer/index.html?filePath=${data.path}` +
93+
const filePath = encodeURIComponent(data.path);
94+
window.location.href =
95+
`/log-viewer/index.html?filePath=${filePath}` +
9496
`#logEventNum=${innerLogEventNum}`;
9597
})
9698
.catch((e: unknown) => {

components/webui/server/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ PRESTO_SCHEMA=default
1818
# Security
1919
RATE_LIMIT=1000
2020

21+
# S3
22+
CLP_STREAM_OUTPUT_AWS_ACCESS_KEY_ID=
23+
CLP_STREAM_OUTPUT_AWS_SECRET_ACCESS_KEY=
24+

0 commit comments

Comments
 (0)