-
Notifications
You must be signed in to change notification settings - Fork 212
Run daemon without registry index watcher in local docker #872
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
Conversation
This will break the metrics for builds. What about adding a |
Hmm, yes, I forgot the metrics were hidden in some globals. Guess we really need to do the internal refactoring to make the queue builder thread more independent before being able to run it in a separate process. Yeah, I'll change it up to just disable that component tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break the metrics for builds.
Only when developing locally, right? I'm ok with local metrics being a little iffy if it means we can split apart the queue builder.
Other than that these changes look great.
Also even if the docker stuff doesn't make it in because of metrics I'd love to have the refactor in so the queue is separate from the daemon. |
Since we're now running the github updater locally, where we're likely to not have given it an access token, I've refactored it completely to work better (using a single reqwest client kept around for connection pooling, and serde for parsing the responses) and deal with rate limiting better. |
src/bin/cratesfyi.rs
Outdated
ctx.config()?, | ||
ctx.pool()?, | ||
ctx.build_queue()?, | ||
!disable_registry_watcher, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double negatives are confusing. Can we change this to --registry-watcher
and --no-registry-watcher
then have it true by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think --disable-registry-watcher
would be a fine flag, disable
makes more sense than no
to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then you get double negatives like we have here, which make it harder to reason about the logic. I'm sure clap has an option to renamed --no-registry-watcher
to --disable-registry-watcher
if you want to keep the same CLI (or just add an alias).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any easy way to do a --flag --no-flag
pair with clap or structopt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use a custom FromStr implementation: https://docs.rs/structopt/0.3.15/structopt/#custom-string-parsers
But that's getting a little more complicated, I'm ok if you want to leave it as-is.
} | ||
}) | ||
.unwrap(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe split this whole if body into a separate function?
0f9c409
to
f84416c
Compare
Allows running all components of the daemon with the registry index watcher disabled in testing environments. This means that you can manually insert crates into the queue with
docker-compose run --rm web queue add serde 1.0.106
and the daemon will pick them up and build them like production. It also means thegithub_updater
andrelease_activity_updater
will run locally.