Skip to content

Commit 7c5aa8a

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 7c5aa8a

50 files changed

Lines changed: 1214 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

‎.github/workflows/base.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ concurrency:
2424
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2525
cancel-in-progress: true
2626

27+
permissions:
28+
contents: read
29+
2730
jobs:
2831
format:
2932
if: ${{ !(github.repository == 'gitmono-dev/mega' && github.event_name == 'push') }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
permissions:
16+
contents: read
17+
18+
env:
19+
REPOSITORY: mega/mega-init
20+
IMAGE_TAG: latest
21+
HARBOR_REGISTRY: registry.xuanwu.openatom.cn
22+
23+
jobs:
24+
build-and-push:
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 15
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Login to Harbor
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ${{ env.HARBOR_REGISTRY }}
35+
username: ${{ secrets.HARBOR_USERNAME }}
36+
password: ${{ secrets.HARBOR_PASSWORD }}
37+
38+
- name: Build, tag, and push docker image to Harbor
39+
run: |
40+
set -euo pipefail
41+
42+
HARBOR_IMAGE_BASE="${{ env.HARBOR_REGISTRY }}/${{ env.REPOSITORY }}"
43+
IMAGE_TAG="${{ env.IMAGE_TAG }}"
44+
SHORT_SHA="${GITHUB_SHA:0:7}"
45+
46+
docker build \
47+
-f scripts/init_mega/Dockerfile \
48+
-t "$HARBOR_IMAGE_BASE:$IMAGE_TAG" \
49+
-t "$HARBOR_IMAGE_BASE:$SHORT_SHA" \
50+
.
51+
52+
docker push "$HARBOR_IMAGE_BASE:$IMAGE_TAG"
53+
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

‎.github/workflows/services.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1616
cancel-in-progress: true
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
# Label of the runner job
2023
runner-job:

‎.github/workflows/web-sync-server-deploy.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}
1616
cancel-in-progress: true
1717

18+
permissions:
19+
contents: read
20+
1821
env:
1922
REGISTRY_ALIAS: m8q5m4u3
2023
REPOSITORY: mega/web-sync-server

‎.github/workflows/web-test.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- '.github/workflows/web-deploy.yml'
99
- 'moon/**'
1010

11+
permissions:
12+
contents: read
13+
1114
env:
1215
TIPTAP_PRIVATE_REGISTRY_KEY: CjqFil0n7z4GGur+RPric21fBBeSB4R4FoNdRYOE1bQEz6AXLCoANCc+o9rLIg6Q
1316

‎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)