Skip to content
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

feat: curio: alertManager #11926

Merged
merged 5 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Dockerfile.curio
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ RUN set -eux; \
COPY ./ /opt/curio
WORKDIR /opt/curio

#RUN scripts/docker-git-state-check.sh

### make configurable filecoin-ffi build
ARG FFI_BUILD_FROM_SOURCE=0
ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE}
Expand Down
2 changes: 1 addition & 1 deletion cmd/curio/deps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (deps *Deps) PopulateRemainingDeps(ctx context.Context, cctx *cli.Context,
}
}

if deps.Cfg == nil {
if deps.DB == nil {
deps.DB, err = MakeDB(cctx)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/curio/guidedsetup/guidedsetup.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func complete(d *MigrationData) {

func completeInit(d *MigrationData) {
stepCompleted(d, d.T("New Miner initialization complete."))
d.say(plain, "Try the web interface with %s for further guided improvements.", "--layers=gui")
d.say(plain, "Try the web interface with %s for further guided improvements.", code.Render("curio run --layers=gui"))
}

func configToDB(d *MigrationData) {
Expand Down
718 changes: 364 additions & 354 deletions cmd/curio/internal/translations/catalog.go

Large diffs are not rendered by default.

62 changes: 55 additions & 7 deletions cmd/curio/internal/translations/locales/en/out.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,44 @@
],
"fuzzy": true
},
{
"id": "Unmigratable sectors found. Do you want to continue?",
"message": "Unmigratable sectors found. Do you want to continue?",
"translation": "Unmigratable sectors found. Do you want to continue?",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Yes, continue",
"message": "Yes, continue",
"translation": "Yes, continue",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "No, abort",
"message": "No, abort",
"translation": "No, abort",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Aborting migration.",
"message": "Aborting migration.",
"translation": "Aborting migration.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "Error",
"string": "%[1]v",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "err.Error()"
}
],
"fuzzy": true
},
{
"id": "Error saving config to layer: {Error}. Aborting Migration",
"message": "Error saving config to layer: {Error}. Aborting Migration",
Expand Down Expand Up @@ -602,13 +640,6 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Aborting migration.",
"message": "Aborting migration.",
"translation": "Aborting migration.",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Sectors verified. {I} sector locations found.",
"message": "Sectors verified. {I} sector locations found.",
Expand Down Expand Up @@ -1552,6 +1583,23 @@
],
"fuzzy": true
},
{
"id": "Migrating metadata for {NSectors} sectors.",
"message": "Migrating metadata for {NSectors} sectors.",
"translation": "Migrating metadata for {NSectors} sectors.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "NSectors",
"string": "%[1]d",
"type": "int",
"underlyingType": "int",
"argNum": 1,
"expr": "nSectors"
}
],
"fuzzy": true
},
{
"id": "Configuration 'base' was updated to include this miner's address ({MinerAddress}) and its wallet setup.",
"message": "Configuration 'base' was updated to include this miner's address ({MinerAddress}) and its wallet setup.",
Expand Down
24 changes: 24 additions & 0 deletions cmd/curio/internal/translations/locales/ko/messages.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,30 @@
"translation": "'base' 설정이 이 lotus-miner의 config.toml과 유사하게 만들어졌습니다.",
"message": "Configuration 'base' was created to resemble this lotus-miner's config.toml .",
"placeholder": null
},
{
"id": "Unmigratable sectors found. Do you want to continue?",
"translation": "이동할 수 없는 섹터가 발견되었습니다. 계속하시겠습니까?",
"message": "Unmigratable sectors found. Do you want to continue?",
"placeholder": null
},
{
"id": "Yes, continue",
"translation": "예, 계속",
"message": "Yes, continue",
"placeholder": null
},
{
"id": "No, abort",
"translation": "아니오, 중단",
"message": "No, abort",
"placeholder": null
},
{
"id": "Migrating metadata for {NSectors} sectors.",
"translation": "{NSectors} 섹터의 메타데이터를 이동 중입니다.",
"message": "Migrating metadata for {NSectors} sectors.",
"placeholder": null
}
]
}
24 changes: 24 additions & 0 deletions cmd/curio/internal/translations/locales/zh/messages.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,30 @@
"translation": "'base'配置已创建,以类似于这个lotus-miner的config.toml。",
"message": "Configuration 'base' was created to resemble this lotus-miner's config.toml .",
"placeholder": null
},
{
"id": "Unmigratable sectors found. Do you want to continue?",
"translation": "发现无法迁移的扇区。您想要继续吗?",
"message": "Unmigratable sectors found. Do you want to continue?",
"placeholder": null
},
{
"id": "Yes, continue",
"translation": "是的,继续",
"message": "Yes, continue",
"placeholder": null
},
{
"id": "No, abort",
"translation": "不,中止",
"message": "No, abort",
"placeholder": null
},
{
"id": "Migrating metadata for {NSectors} sectors.",
"translation": "正在迁移{NSectors}个扇区的元数据。",
"message": "Migrating metadata for {NSectors} sectors.",
"placeholder": null
}
]
}
4 changes: 4 additions & 0 deletions cmd/curio/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/filecoin-project/lotus/cmd/curio/deps"
curio "github.com/filecoin-project/lotus/curiosrc"
"github.com/filecoin-project/lotus/curiosrc/alertmanager"
"github.com/filecoin-project/lotus/curiosrc/chainsched"
"github.com/filecoin-project/lotus/curiosrc/ffi"
"github.com/filecoin-project/lotus/curiosrc/gc"
Expand Down Expand Up @@ -144,6 +145,9 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps) (*harmonytask.Task
activeTasks = append(activeTasks, storageEndpointGcTask)
}

amTask := alertmanager.NewAlertTask(full, db, cfg.Alerting)
activeTasks = append(activeTasks, amTask)

if needProofParams {
for spt := range dependencies.ProofTypes {
if err := modules.GetParams(true)(spt); err != nil {
Expand Down
Loading
Loading