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: sealing: Allow overriding worker hostname #9116

Merged
merged 4 commits into from
Aug 3, 2022
Merged

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Aug 3, 2022

Related Issues

This PR expands #7937 a bit

Proposed Changes

  • Add a new config field to lotus-miner - Storage.LocalWorkerName
  • Add a new flag/envvar to lotus-worker - --name/LOTUS_WORKER_NAME
  • When set, use that name instead of the worker hostname in places where worker names are visible

TODO

  • Write an itest
  • Go through sealer code looking for missed os.Hostname calls
  • Test manually
    • miner-builtin worker name
    • lotus-worker name

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@magik6k magik6k force-pushed the feat/worker-name-set branch from 42afdb0 to da33d82 Compare August 3, 2022 10:58
@magik6k magik6k marked this pull request as ready for review August 3, 2022 11:07
@magik6k magik6k requested a review from a team as a code owner August 3, 2022 11:07
@rjan90
Copy link
Contributor

rjan90 commented Aug 3, 2022

Did some tests on this:

  • miner-builtin worker name
    • Using env-variable: export LOTUS_STORAGE_LOCALWORKERNAME="Lotus-Miner-Worker"
lotus-miner sealing workers
Worker 492bff51-6f4c-4178-8f88-49cdcdd3c0e8, host Lotus-Miner-Worker
        CPU:  [                                                                ] 0/12 core(s) in use
        RAM:  [||                                                              ] 2% 1.667 GiB/62.79 GiB
        VMEM: [|                                                               ] 0% 1.726 GiB/190.8 GiB
  • Using config-value:
    LocalWorkerName = "Lotus-Miner-Worker"
lotus-miner sealing workers
Worker 492bff51-6f4c-4178-8f88-49cdcdd3c0e8, host Lotus-Miner-Worker
        CPU:  [                                                                ] 0/12 core(s) in use
        RAM:  [||                                                              ] 2% 1.667 GiB/62.79 GiB
        VMEM: [|                                                               ] 0% 1.726 GiB/190.8 GiB
  • lotus-worker name
    • Using lotus-worker run --name lotus-worker
lotus-miner sealing workers
Worker d258dfb1-948c-491a-914e-b8fda6399090, host lotus-worker
        CPU:  [                                                                ] 0/12 core(s) in use
        RAM:  [||                                                              ] 2% 1.747 GiB/62.79 GiB
        VMEM: [|                                                               ] 0% 1.806 GiB/190.8 GiB
Worker ebbe01fa-7b7e-4eb1-b6df-6cfd1cc8882b, host Lotus-Miner-Worker
        CPU:  [                                                                ] 0/12 core(s) in use
        RAM:  [||                                                              ] 2% 1.674 GiB/62.79 GiB
        VMEM: [|                                                               ] 0% 1.733 GiB/190.8 GiB
  • Using env-variable: export LOTUS_WORKER_NAME=lotus-worker
Worker 0bade628-4e1e-4994-b5d6-810d407ab629, host lotus-worker
        CPU:  [                                                                ] 0/12 core(s) in use
        RAM:  [||                                                              ] 3% 2.012 GiB/62.79 GiB
        VMEM: [|                                                               ] 1% 2.071 GiB/190.8 GiB
Worker ebbe01fa-7b7e-4eb1-b6df-6cfd1cc8882b, host Lotus-Miner-Worker
        CPU:  [                                                                ] 0/12 core(s) in use
        RAM:  [||                                                              ] 2% 1.674 GiB/62.79 GiB
        VMEM: [|                                                               ] 0% 1.733 GiB/190.8 GiB

Also looks good in the sealing jobs output:

lotus-miner sealing jobs
ID        Sector  Worker    Hostname            Task  State    Time
5d448b7b  1       ebbe01fa  Lotus-Miner-Worker  PC1   running  3.5s

@magik6k magik6k merged commit ab05922 into master Aug 3, 2022
@magik6k magik6k deleted the feat/worker-name-set branch August 3, 2022 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants