Skip to content

Latest commit

 

History

History
149 lines (107 loc) · 5.6 KB

config-overrides.md

File metadata and controls

149 lines (107 loc) · 5.6 KB

How to Override Configuration for In-Vehicle Stack Containers

The following In-Vehicle Stack services have configuration that can be overridden:

Please refer to the above links to determine what configuration files you would like to override. Then follow the steps below for the specific orchestrator you are using.

Override In-Vehicle Stack configuration in Eclipse Ankaios

Prerequisites

Steps

  1. In the Ankaios devcontainer, open a terminal and create a directory under /etc to store the desired project configuration files:

    mkdir -p /etc/<project_name>/config
    

    for example:

    mkdir -p /etc/freyja/config
    
  2. Create the desired configuration files in the newly created directory:

    touch <config_file_name>.<ext>
    

    for example, to create a configuration file to override the mapping configuration for Freyja:

    touch mock_mapping_config.json
    
  3. Populate the newly created configuration files with the configuration you wish to override using any text editor.

  4. Next, we need to pass the configuration into the containers. To do this, we will need to modify startupState.yaml. This will be done by mounting the directory created in step 1 into the container using the commandOptions parameter list. Find the entry for the project you are trying to override config for and add following to the options:

    "--mount", "type=bind,src=/etc/<project_name>/config,dst=/mnt/config,ro=true"
    

    Note: Replace <project_name> with the project you are overriding config for.

    for example:

    runtimeConfig: |
      image: sdvblueprint.azurecr.io/sdvblueprint/eclipse-freyja/local-with-ibeji:0.1.0
      commandOptions: ["--network", "host", "--name", "cloud-sync", "--mount", "type=bind,src=/etc/freyja/config,dst=/mnt/config,ro=true"]
    

The In-Vehicle Stack service will now use your modified configuration. Note that any configuration changes will require a restart of the in-vehicle stack. You can restart the in-vehicle stack by following the steps for Ankaios.

Override In-Vehicle Stack configuration in Eclipse BlueChi

Prerequisites

Steps

  1. In the BlueChi devcontainer, open a terminal and create a directory under /etc to store the desired project configuration files:

    mkdir -p /etc/<project_name>/config
    

    for example:

    mkdir -p /etc/freyja/config
    
  2. Create the desired configuration files in the newly created directory:

    touch <config_file_name>.<ext>
    

    for example, to create a configuration file to override the mapping configuration for Freyja:

    touch mock_mapping_config.json
    
  3. Populate the newly created configuration files with the configuration you wish to override using any text editor.

  4. Next, we need to pass the configuration into the containers. To do this, we will need to modify the /etc/containers/systemd/<service_name>.yml file for your service (replace <service_name> with your service name). This will be done by mounting the directory created in step 1 into the container using volumeMounts. You can see an example in this configuration in the /etc/containers/systemd/azure-cloud-connector.yml file in the bluechi devcontainer.

    • In your file, add a "volumes" section:

        volumes:
          - name: project-config
            hostPath:
              path: /etc/<project_name>/config
              type: DirectoryOrCreate
      

      Note: Replace <project_name> with the project you are overriding config for.

      for example:

        volumes:
          - name: freyja-config
            hostPath:
              path: /etc/freyja/config
              type: DirectoryOrCreate
      
    • Refer to this volume in the "containers" section, for example:

        containers:
          - name: app
            image: sdvblueprint.azurecr.io/sdvblueprint/eclipse-freyja/azure-cloud-connector:0.1.0
            imagePullPolicy: IfNotPresent
            volumeMounts:
            - mountPath: /mnt/config
              name: freyja-config
      

The In-Vehicle Stack service will now use your modified configuration. Note that any configuration changes will require a restart of the in-vehicle stack. You can restart the in-vehicle stack by following the steps for BlueChi cleanup and bootstrap again.