Skip to content

Commit 270bc83

Browse files
committed
feat(init_mega): ship mega-init image and drop libra import
Add Dockerfile and deploy workflow for buckal-bundles sync only, and remove the optional --with-libra / import-buck2-deps path from init_mega so the Job stays focused on toolchains sync.
1 parent b16ea3b commit 270bc83

47 files changed

Lines changed: 1185 additions & 364 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.dockerignore‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ tools/**
1313

1414
docs
1515

16-
scripts
16+
# Exclude scripts by default (large / unused in most images), but keep the
17+
# paths required by scripts/init_mega/Dockerfile (mega-init image).
18+
scripts/*
19+
!scripts/init_mega/
20+
!scripts/init_mega/**
21+
!scripts/import-buck2-deps/
22+
!scripts/import-buck2-deps/**
1723

1824
tests
1925

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Mega Init deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- ".github/workflows/mega-init-deploy.yml"
9+
- "scripts/init_mega/**"
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
REPOSITORY: mega/mega-init
17+
IMAGE_TAG: latest
18+
HARBOR_REGISTRY: registry.xuanwu.openatom.cn
19+
20+
jobs:
21+
build-and-push:
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 15
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Login to Harbor
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ${{ env.HARBOR_REGISTRY }}
32+
username: ${{ secrets.HARBOR_USERNAME }}
33+
password: ${{ secrets.HARBOR_PASSWORD }}
34+
35+
- name: Build, tag, and push docker image to Harbor
36+
run: |
37+
set -euo pipefail
38+
39+
HARBOR_IMAGE_BASE="${{ env.HARBOR_REGISTRY }}/${{ env.REPOSITORY }}"
40+
IMAGE_TAG="${{ env.IMAGE_TAG }}"
41+
SHORT_SHA="${GITHUB_SHA:0:7}"
42+
43+
docker build \
44+
-f scripts/init_mega/Dockerfile \
45+
-t "$HARBOR_IMAGE_BASE:$IMAGE_TAG" \
46+
-t "$HARBOR_IMAGE_BASE:$SHORT_SHA" \
47+
.
48+
49+
docker push "$HARBOR_IMAGE_BASE:$IMAGE_TAG"
50+
docker push "$HARBOR_IMAGE_BASE:$SHORT_SHA"

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
context: .
2828
dockerfile: orion-server/Dockerfile
2929

30+
- name: mega-init
31+
context: .
32+
dockerfile: scripts/init_mega/Dockerfile
33+
3034
steps:
3135
- name: Checkout
3236
uses: actions/checkout@v4

‎Cargo.lock‎

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ git-internal = "0.8.4"
4242
libvault-core = "0.1.0"
4343

4444
#====
45-
anyhow = "1.0.103"
46-
serde = { version = "1.0.228", features = ["derive"] }
45+
anyhow = "1.0.104"
46+
serde = { version = "1.0.229", features = ["derive"] }
4747
serde_json = "1.0.151"
4848
serde_urlencoded = "0.7"
4949
tracing = "0.1.44"
@@ -56,11 +56,11 @@ clap = "4.6.4"
5656
tokio = "1.53.1"
5757
tokio-stream = "0.1.19"
5858
tokio-util = "0.7.19"
59-
async-trait = "0.1.89"
59+
async-trait = "0.1.91"
6060
async-stream = "0.3.6"
6161
async-recursion = "1.1.1"
62-
futures = "0.3.32"
63-
futures-util = "0.3.32"
62+
futures = "0.3.33"
63+
futures-util = "0.3.33"
6464
axum = { version = "0.8.9", features = ["macros", "json"] }
6565
axum-extra = "0.12.6"
6666
russh = "0.62.4"
@@ -94,8 +94,8 @@ hmac = "0.13"
9494
idgenerator = "2.0.0"
9595
config = "0.15.25"
9696
reqwest = "0.13.4"
97-
uuid = "1.23.5"
98-
regex = "1.13.0"
97+
uuid = "1.24.0"
98+
regex = "1.13.1"
9999
ctrlc = "3.5.2"
100100
cedar-policy = "4.11.2"
101101
secp256k1 = "0.31.1"
@@ -123,12 +123,12 @@ bs58 = "0.5.1"
123123
indexmap = "2.14"
124124
envsubst = "0.2.1"
125125
directories = "6.0.0"
126-
redis = "1.3.0"
126+
redis = "1.4.1"
127127
redis-test = "1.0.4"
128128
rustls = "0.23.42"
129-
object_store = "0.14.0"
129+
object_store = "0.14.1"
130130
parse-display = "0.11.0"
131-
toml = "1.1.2"
131+
toml = "1.1.3"
132132
rkyv = "0.8.17"
133133
percent-encoding = "2.3"
134134

‎ceres/src/application/api_service/mono/admin/bot.rs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ impl AdminApplicationService {
105105
})
106106
}
107107

108+
/// Ensure mega-init bot + fresh push token (for unauthenticated bootstrap-init).
109+
pub async fn ensure_init_bot_token(
110+
&self,
111+
) -> Result<crate::model::bots::BootstrapInitBotResponse, MegaError> {
112+
let (bot, token_plain) = self
113+
.ctx
114+
.storage()
115+
.bots_storage()
116+
.ensure_init_bot_token()
117+
.await?;
118+
Ok(crate::model::bots::BootstrapInitBotResponse {
119+
bot_id: bot.id,
120+
bot_name: bot.name,
121+
token: token_plain,
122+
})
123+
}
124+
108125
pub async fn list_bot_tokens(&self, bot_id: i64) -> Result<Vec<ListBotTokenItem>, MegaError> {
109126
Ok(self
110127
.ctx

0 commit comments

Comments
 (0)