-
Notifications
You must be signed in to change notification settings - Fork 3
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
Containerize the appliaction #13
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
60dc443
to
1639b7f
Compare
33f11c8
to
1d2b0cc
Compare
abace5f
to
7499604
Compare
262d342
to
ff94107
Compare
fb179b9
to
ed2deff
Compare
As wrongly commented on the next pr. I think that we should set a default location only when running in docker to make the command needed to run the application from the docker hub smaller. |
src/main.rs
Outdated
@@ -51,6 +52,13 @@ async fn main() -> eyre::Result<()> { | |||
if let Err(err) = astarte_cfg_builder.try_from_env() { | |||
warn!("failed to retrieve Astarte connection config from ENV: {err}"); | |||
|
|||
#[cfg(feature = "docker")] |
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.
Instead of using the feature you could use an .unwrap_or_default
invoked only when the feature is docker.
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 agree, since astarte_config_path
is an optional parameter you can use a default value if it is not provided and since the docker
feature is only used here it can be removed.
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've done some modification to the code to avoid retrieving the path from the CLI. Still, to provide flexibility (to change the comfig.toml path) i maintained the env variable ASTARTE_CONFIG_PATH, which is retrievable only if containers are not used. If it is not set, the default path /etc/stream-rust-test/
is used
Signed-off-by: Riccardo Gallo <riccardo.gallo@secomind.com>
In this commit: - Define scripts, env file and Dockerfile to build and run the container - Get astarte config from env vars - Add dependabot checks for docker - Update Readme with the information to build and run a docker container Signed-off-by: Riccardo Gallo <riccardo.gallo@secomind.com>
Gracefully shut down all the active tasks when SIGINT or SIGTERM signals are received. Signed-off-by: Riccardo Gallo <riccardo.gallo@secomind.com>
…fig.toml If the application is run using the container, the config.toml config file location is set to /etc/stream-rust-test/, otherwise it can be modified by using the ASTARTE_CONFIG_PATH env variable Signed-off-by: Riccardo Gallo <riccardo.gallo@secomind.com>
Make it possible to build a Docker container of the application and set all the necessary config files and environment variables to connect it to a running Astarte instance.
Closes #2