Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
User can name runtime image
Browse files Browse the repository at this point in the history
Signed-off-by: Emerson Knapp <[email protected]>
  • Loading branch information
emersonknapp committed Aug 16, 2020
1 parent 665878d commit d23f6e6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
2 changes: 2 additions & 0 deletions ros_cross_compile/docker/runtime.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ARG BASE_IMAGE
FROM $BASE_IMAGE
WORKDIR /ros_ws

RUN apt-get update && apt-get install -q -y --no-install-recommends less vim

ARG INSTALL_PATH
COPY $INSTALL_PATH/ /ros_ws/install

Expand Down
14 changes: 9 additions & 5 deletions ros_cross_compile/pipeline_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@
As such, the documentation for each customization can be found by looking at the
argparse options in ros_cross_compile.py.
"""
PipelineStageConfigOptions = NamedTuple('PipelineStageConfigOptions',
[('skip_rosdep_keys', List[str]),
('custom_script', Optional[Path]),
('custom_data_dir', Optional[Path]),
('custom_setup_script', Optional[Path])])
PipelineStageConfigOptions = NamedTuple(
'PipelineStageConfigOptions',
[
('skip_rosdep_keys', List[str]),
('custom_script', Optional[Path]),
('custom_data_dir', Optional[Path]),
('custom_setup_script', Optional[Path]),
('runtime_tag', str),
])


class PipelineStage(ABC):
Expand Down
8 changes: 6 additions & 2 deletions ros_cross_compile/ros_cross_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ def parse_args(args: List[str]) -> argparse.Namespace:
default=[],
help='Skip these steps')
parser.add_argument(
'--create-runtime-image',
'--runtime-tag',
type=str,
required=False,
default='cc-runtime',
help='Create a Docker image with the specified name that contains all '
'runtime dependencies and the created "install" directory for the workspace.')

Expand Down Expand Up @@ -194,7 +197,8 @@ def cross_compile_pipeline(
skip_rosdep_keys,
custom_rosdep_script,
custom_data_dir,
custom_setup_script)
custom_setup_script,
args.runtime_tag)

for stage in stages:
if stage.name not in args.skip_steps:
Expand Down
10 changes: 6 additions & 4 deletions ros_cross_compile/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ class PackageRuntimeImage(PipelineStage):
def __init__(self):
super().__init__('package_runtime')

def __call__(self, platform: Platform, docker_client: DockerClient, ros_workspace_dir: Path,
pipeline_stage_config_options: PipelineStageConfigOptions,
data_collector: DataCollector):
create_runtime_image(docker_client, platform, ros_workspace_dir, 'cc-runtime')
def __call__(
self, platform: Platform, docker_client: DockerClient, ros_workspace_dir: Path,
options: PipelineStageConfigOptions,
data_collector: DataCollector
):
create_runtime_image(docker_client, platform, ros_workspace_dir, options.runtime_tag)

0 comments on commit d23f6e6

Please sign in to comment.