Skip to content

Commit

Permalink
Merge pull request #855 from ipfs-force-community/cherry-pick-pr-853-…
Browse files Browse the repository at this point in the history
…854-to-release-v0.7

Cherry pick pr #853 #854 to release/v0.7
  • Loading branch information
0x5459 authored Jul 31, 2023
2 parents c0a8828 + 1036ced commit 3ad64d0
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 32 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.7.3
- damocles-manager
- 恢复 util sealer sectors abort 命令 [#853](https://github.com/ipfs-force-community/damocles/pull/853)

## v0.7.2
- damocles-worker
- 修复封装任务 panic 导致 damocles-worker 进程退出的 bug [#834](https://github.com/ipfs-force-community/damocles/pull/834)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,36 +112,47 @@ var utilSealerSectorsAbortCmd = &cli.Command{
Name: "abort",
Usage: "Abort specified online sector job",
ArgsUsage: "<miner actor> <sector number>",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "really-do-it",
Usage: "WARNING: This command may result in inconsistent state of damocles-manager and damocles-worker. If you know what you're doing, use it",
Value: false,
},
},
Action: func(cctx *cli.Context) error {
return fmt.Errorf("this command is not available in the current version, please use the `damocles-worker worker -c <config file path> resume --state Aborted --index <index>` or `damocles-manager util worker resume <worker instance name or address> <thread index> Aborted` commands instead.\n See: https://github.com/ipfs-force-community/damocles/blob/main/docs/en/11.task-status-flow.md#1-for-a-sector-sealing-task-that-has-been-paused-due-to-an-error-and-cannot-be-resumed-such-as-the-ticket-has-expired-you-can-use")
// if count := cctx.Args().Len(); count < 2 {
// return fmt.Errorf("both miner actor id & sector number are required, only %d args provided", count)
// }

// miner, err := ShouldActor(cctx.Args().Get(0), true)
// if err != nil {
// return fmt.Errorf("invalid miner actor id: %w", err)
// }

// sectorNum, err := strconv.ParseUint(cctx.Args().Get(1), 10, 64)
// if err != nil {
// return fmt.Errorf("invalid sector number: %w", err)
// }

// cli, gctx, stop, err := extractAPI(cctx)
// if err != nil {
// return err
// }

// defer stop()

// _, err = cli.Sealer.ReportAborted(gctx, abi.SectorID{
// Miner: miner,
// Number: abi.SectorNumber(sectorNum),
// }, "aborted via CLI")
// if err != nil {
// return fmt.Errorf("abort sector failed: %w", err)
// }
// return fmt.Errorf("this command is not available in the current version, please use the `damocles-worker worker -c <config file path> resume --state Aborted --index <index>` or `damocles-manager util worker resume <worker instance name or address> <thread index> Aborted` commands instead.\n See: https://github.com/ipfs-force-community/damocles/blob/main/docs/en/11.task-status-flow.md#1-for-a-sector-sealing-task-that-has-been-paused-due-to-an-error-and-cannot-be-resumed-such-as-the-ticket-has-expired-you-can-use")
if count := cctx.Args().Len(); count < 2 {
return fmt.Errorf("both miner actor id & sector number are required, only %d args provided", count)
}
if !cctx.Bool("really-do-it") {
fmt.Println("If you know what you're doing, Pass --really-do-it to actually execute this action")
return nil
}
miner, err := ShouldActor(cctx.Args().Get(0), true)
if err != nil {
return fmt.Errorf("invalid miner actor id: %w", err)
}

sectorNum, err := strconv.ParseUint(cctx.Args().Get(1), 10, 64)
if err != nil {
return fmt.Errorf("invalid sector number: %w", err)
}

cli, gctx, stop, err := extractAPI(cctx)
if err != nil {
return err
}

defer stop()

_, err = cli.Damocles.ReportAborted(gctx, abi.SectorID{
Miner: miner,
Number: abi.SectorNumber(sectorNum),
}, "aborted via CLI")
if err != nil {
return fmt.Errorf("abort sector failed: %w", err)
}
return nil
},
}

Expand Down
2 changes: 1 addition & 1 deletion damocles-manager/ver/ver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ver

import "fmt"

const Version = "0.7.2"
const Version = "0.7.3"

var Commit string

Expand Down
2 changes: 1 addition & 1 deletion damocles-worker/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion damocles-worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "damocles-worker"
version = "0.7.2"
version = "0.7.3"
authors = ["dtynn <[email protected]>"]
edition = "2021"
exclude = [
Expand Down

0 comments on commit 3ad64d0

Please sign in to comment.