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

Add container support for Ibeji #62

Merged
merged 15 commits into from
Oct 27, 2023
Merged

Add container support for Ibeji #62

merged 15 commits into from
Oct 27, 2023

Conversation

devkelley
Copy link
Contributor

This PR adds containerization support for Docker and Podman. In addition:

  • Adds configuration files for building the invehicle-digital-twin service in standalone or integrated mode.
    • Integrated mode sets the invehicle-digital-twin service to use Chariott and Agemo.
  • Adds code that will use appropriate localhost alias when the containerized feature flag is set.
  • Add documentation for running the service in a container

Additionally:

  • fixes minor setup error with running the managed_subscribe sample

################################################################################
# Create a stage for building the application.

ARG RUST_VERSION=1.72.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way for this to be controlled by the rust-toolchain.toml file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in a simple way, there may be a way to copy the value from the rust-toolchain.toml file or install rust manually but I am not sure it is worth it at this point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this goes in as is, then let's make it a high priority follow-up to address this. I have some ideas on how to do this. Perhaps we can have a 15 min brainstorming on the best way to do it and to make sure that the solution gets into all of our software components.

Copy link
Contributor

@ashbeitz ashbeitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments. Please take a look.

################################################################################
# Create a stage for building the application.

ARG RUST_VERSION=1.72.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this goes in as is, then let's make it a high priority follow-up to address this. I have some ideas on how to do this. Perhaps we can have a 15 min brainstorming on the best way to do it and to make sure that the solution gets into all of our software components.

Dockerfile Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
core/common/src/utils.rs Outdated Show resolved Hide resolved
#[cfg(feature = "containerize")]
let uri = {
// Container env variable names.
const HOST_GATEWAY_ENV_VAR: &str = "HOST_GATEWAY";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps these constants should be moved out of this function (perhaps to s shared constant code file) and made public?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the idea was to keep the constants with this function because it is only used in a container, and those values should be set by the .env files provided

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they are only ever used once, then they probably don't even need to be constants.

core/invehicle-digital-twin/src/main.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@ladatz ladatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor comments

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
core/common/src/utils.rs Fixed Show fixed Hide fixed
ashbeitz
ashbeitz previously approved these changes Oct 26, 2023
Copy link
Contributor

@ashbeitz ashbeitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

#[cfg(feature = "containerize")]
let uri = {
// Container env variable names.
const HOST_GATEWAY_ENV_VAR: &str = "HOST_GATEWAY";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they are only ever used once, then they probably don't even need to be constants.

README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@ashbeitz ashbeitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve.

@ashbeitz ashbeitz merged commit 9f019ed into eclipse-ibeji:main Oct 27, 2023
10 of 12 checks passed
mobicatk pushed a commit to Mobica/EclipseSDV_ibeji that referenced this pull request Apr 24, 2024
* Add dockerfiles and supporting configuration to Ibeji

* removed uncessary build dependencies

* ignore devskim warnings

* resolve README comments

* fixed typo

* set IBEJI_HOME environment variable in dockerfile

* Update get_uri to return what env variable the failure was for

* fix devskim err

* attempt 2 of fixing devskim

* change var name as ignoring creates a fmt error

* remove commented feature flag

* changed const to variables

* fix feature flag

* Rearrange README
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.

5 participants