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

WIP add Ignition #378

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
42 changes: 42 additions & 0 deletions .github/workflows/ignition_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI Ignition images

on:
pull_request:
paths:
- 'ignition/blueprint/**'
- 'ignition/citadel/**'
- 'ignition/ignition'
push:
paths:
- 'ignition/blueprint/**'
- 'ignition/citadel/**'
- 'ignition/ignition'
schedule:
# Trigger daily to check for upstream changes
- cron: '0 0 * * *'
jobs:
check_images:
strategy:
fail-fast: false
matrix:
env:
- {HUB_REPO: ignition, HUB_RELEASE: blueprint, HUB_OS_NAME: ubuntu, HUB_OS_CODE_NAME: bionic}
- {HUB_REPO: ignition, HUB_RELEASE: citadel, HUB_OS_NAME: ubuntu, HUB_OS_CODE_NAME: bionic}
runs-on: ubuntu-latest
env:
GITHUBEMAIL: ${{ secrets.GITHUBEMAIL }}
GITHUBTOKEN: ${{ secrets.GITHUBTOKEN }}
GITHUBUSER: ${{ secrets.GITHUBUSER }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r docker/requirements.txt
pip install -r .ci/requirements.txt
- name: Check and build Ignition image
env: ${{matrix.env}}
run: .ci/ci_script.py
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This repo hosts Dockerfiles and scaffolding for images in the Official Library a
[Official docker library](https://github.com/osrf/docker_images/blob/master/README.md#official-library)<br/>
[Official ROS (1 and 2) images](https://github.com/osrf/docker_images/blob/master/README.md#ros--)<br/>
[Official Gazebo images](https://github.com/osrf/docker_images/blob/master/README.md#gazebo--)<br/>
[Official Ignition images](https://github.com/osrf/docker_images/blob/master/README.md#ignition--)<br/>
[OSRF ROS (1 and 2) overlay images](https://github.com/osrf/docker_images/blob/master/README.md#ros---1)<br/>
[OSRF ROS 2 development images](https://github.com/osrf/docker_images/blob/master/README.md#ros2--)<br/>
[OSRF Gazebo overlay images](https://github.com/osrf/docker_images/blob/master/README.md#gazebo---1)<br/>
Expand All @@ -16,6 +17,7 @@ This repo hosts Dockerfiles and scaffolding for images in the Official Library a
| ROS | [![Build Status](https://github.com/osrf/docker_images/workflows/CI%20ROS%20images/badge.svg?branch=master)](https://github.com/osrf/docker_images/actions?query=workflow%3A%22CI+ROS+images%22+event%3Aschedule)
| ROS 2 | [![Build Status](https://github.com/osrf/docker_images/workflows/CI%20ROS%202%20images/badge.svg?branch=master)](https://github.com/osrf/docker_images)
| Gazebo | [![Build Status](https://github.com/osrf/docker_images/workflows/CI%20Gazebo%20images/badge.svg?branch=master)](https://github.com/osrf/docker_images/actions?query=workflow%3A%22CI+Gazebo+images%22+event%3Aschedule)
| Ignition | [![Build Status](https://github.com/osrf/docker_images/workflows/CI%20Ignition%20images/badge.svg?branch=master)](https://github.com/osrf/docker_images/actions?query=workflow%3A%22CI+Ignition+images%22+event%3Aschedule)

---

Expand Down Expand Up @@ -63,6 +65,26 @@ For complete listing of tag, view the Repo Info link below.
| [arm64v8](https://hub.docker.com/r/arm64v8/gazebo/tags) | [![Build Status](https://doi-janky.infosiftr.net/buildStatus/icon?job=multiarch/arm64v8/gazebo)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/gazebo/) |
-->

### [Ignition ![Docker Pulls](https://img.shields.io/docker/pulls/_/ignition.svg?label=pulls) ![Docker Stars](https://img.shields.io/docker/stars/_/ignition.svg?label=stars)](https://hub.docker.com/_/ignition)

This repo contains images available for Ignition.
For more documentation on using these images, view the Docker Hub repo link above.
Images are tagged by releases version, meta package, as well as code name for supported OS base images.
For complete listing of tag, view the Repo Info link below.

#### [Repo Info](https://github.com/docker-library/repo-info/tree/master/repos/ignition)

[![Compare Images](https://images.microbadger.com/badges/image/library/ignition.svg)](https://microbadger.com/#/images/library/ignition)

#### Architectures

| Type | Status |
|---|---|
| [amd64](https://hub.docker.com/r/amd64/ignition/tags) | [![Build Status](https://doi-janky.infosiftr.net/buildStatus/icon?job=multiarch/amd64/ignition)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/ignition/) |
<!--
| [arm32v7](https://hub.docker.com/r/arm32v7/ignition/tags) | [![Build Status](https://doi-janky.infosiftr.net/buildStatus/icon?job=multiarch/arm32v7/ignition)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/ignition/) |
| [arm64v8](https://hub.docker.com/r/arm64v8/ignition/tags) | [![Build Status](https://doi-janky.infosiftr.net/buildStatus/icon?job=multiarch/arm64v8/ignition)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/ignition/) |
-->
---

## [OSRF Profile](https://hub.docker.com/u/osrf/)
Expand Down
2 changes: 1 addition & 1 deletion docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pyyaml
###### Requirements with Repo Specifiers ######
# See https://pip.readthedocs.io/en/stable/reference/pip_install/#git
git+git://github.com/ros-infrastructure/ros_buildfarm.git@master#egg=ros_buildfarm
git+git://github.com/osrf/docker_templates.git@master#egg=docker_templates
git+git://github.com/osrf/docker_templates.git@ignition#egg=docker_templates

###### Requirements with Version Specifiers ######
# See https://www.python.org/dev/peps/pep-0440/#version-specifiers
Expand Down
19 changes: 19 additions & 0 deletions ignition/.config/Makefile.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
all: help

help:
@echo ""
@echo "-- Help Menu"
@echo ""
@echo " 1. make build - build all images"
@echo " 2. make pull - pull all images"
@echo " 3. make clean - remove all images"
@echo ""

build:
@docker build --tag=ignition:$release_name-$os_code_name ignition/.

pull:
@docker pull ignition:$release_name-$os_code_name

clean:
@docker rmi -f ignition:$release_name-$os_code_name
13 changes: 13 additions & 0 deletions ignition/.config/images.yaml.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%YAML 1.1
# Ignition Dockerfile database
---
images:
ignition:
base_image: @(os_name):@(os_code_name)
maintainer_name: @(maintainer_name)
template_name: docker_images/create_ignition_image.Dockerfile.em
# entrypoint_name: docker_images/no_entrypoint.sh
template_packages:
- docker_templates
ignition_packages:
- ignition-@(ignition_version)
13 changes: 13 additions & 0 deletions ignition/.config/platform.yaml.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%YAML 1.1
# Ignition Dockerfile database
---
platform:
os_name: $os_name
os_code_name: $os_code_name
ignition_version: $release_name
user_name: ignition
maintainer_name:
arch: amd64
type: distribution
version:
release: stable
19 changes: 19 additions & 0 deletions ignition/blueprint/ubuntu/bionic/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
all: help

help:
@echo ""
@echo "-- Help Menu"
@echo ""
@echo " 1. make build - build all images"
@echo " 2. make pull - pull all images"
@echo " 3. make clean - remove all images"
@echo ""

build:
@docker build --tag=ignition:blueprint-bionic ignition/.

pull:
@docker pull ignition:blueprint-bionic

clean:
@docker rmi -f ignition:blueprint-bionic
29 changes: 29 additions & 0 deletions ignition/blueprint/ubuntu/bionic/ignition/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This is an auto generated Dockerfile for ignition:ignition
# generated from docker_images/create_ignition_image.Dockerfile.em
FROM ubuntu:bionic

# setup timezone
RUN echo 'Etc/UTC' > /etc/timezone && \
ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
apt-get update && apt-get install -q -y tzdata && rm -rf /var/lib/apt/lists/*

# install packages
RUN apt-get update && apt-get install -q -y \
dirmngr \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*

# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD83DB69272AFE98867170598AF249743

# setup sources.list
RUN . /etc/os-release \
&& echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list

# install ignition packages
RUN apt-get update && apt-get install -q -y \
ignition-blueprint=1.0.0-1* \
&& rm -rf /var/lib/apt/lists/*

CMD ["ign", "gazebo", "-s"]
13 changes: 13 additions & 0 deletions ignition/blueprint/ubuntu/bionic/images.yaml.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%YAML 1.1
# Ignition Dockerfile database
---
images:
ignition:
base_image: @(os_name):@(os_code_name)
maintainer_name: @(maintainer_name)
template_name: docker_images/create_ignition_image.Dockerfile.em
# entrypoint_name: docker_images/no_entrypoint.sh
template_packages:
- docker_templates
ignition_packages:
- ignition-@(ignition_version)
13 changes: 13 additions & 0 deletions ignition/blueprint/ubuntu/bionic/platform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%YAML 1.1
# Ignition Dockerfile database
---
platform:
os_name: ubuntu
os_code_name: bionic
ignition_version: blueprint
user_name: ignition
maintainer_name:
arch: amd64
type: distribution
version:
release: stable
19 changes: 19 additions & 0 deletions ignition/citadel/ubuntu/bionic/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
all: help

help:
@echo ""
@echo "-- Help Menu"
@echo ""
@echo " 1. make build - build all images"
@echo " 2. make pull - pull all images"
@echo " 3. make clean - remove all images"
@echo ""

build:
@docker build --tag=ignition:citadel-bionic ignition/.

pull:
@docker pull ignition:citadel-bionic

clean:
@docker rmi -f ignition:citadel-bionic
29 changes: 29 additions & 0 deletions ignition/citadel/ubuntu/bionic/ignition/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This is an auto generated Dockerfile for ignition:ignition
# generated from docker_images/create_ignition_image.Dockerfile.em
FROM ubuntu:bionic

# setup timezone
RUN echo 'Etc/UTC' > /etc/timezone && \
ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
apt-get update && apt-get install -q -y tzdata && rm -rf /var/lib/apt/lists/*

# install packages
RUN apt-get update && apt-get install -q -y \
dirmngr \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*

# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD83DB69272AFE98867170598AF249743

# setup sources.list
RUN . /etc/os-release \
&& echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list

# install ignition packages
RUN apt-get update && apt-get install -q -y \
ignition-citadel=1.0.0-1* \
&& rm -rf /var/lib/apt/lists/*

CMD ["ign", "gazebo", "-s"]
13 changes: 13 additions & 0 deletions ignition/citadel/ubuntu/bionic/images.yaml.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%YAML 1.1
# Ignition Dockerfile database
---
images:
ignition:
base_image: @(os_name):@(os_code_name)
maintainer_name: @(maintainer_name)
template_name: docker_images/create_ignition_image.Dockerfile.em
# entrypoint_name: docker_images/no_entrypoint.sh
template_packages:
- docker_templates
ignition_packages:
- ignition-@(ignition_version)
13 changes: 13 additions & 0 deletions ignition/citadel/ubuntu/bionic/platform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%YAML 1.1
# Ignition Dockerfile database
---
platform:
os_name: ubuntu
os_code_name: bionic
ignition_version: citadel
user_name: ignition
maintainer_name:
arch: amd64
type: distribution
version:
release: stable
70 changes: 70 additions & 0 deletions ignition/create_dockerfiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env python3

import os
import sys
import yaml

try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
from em import Interpreter

from docker_templates.argparse import DockerfileArgParser
from docker_templates.create import create_files
from docker_templates.collections import OrderedLoad
from docker_templates.packages import expandPackages

def main(argv=sys.argv[1:]):
"""Create Dockerfiles for images from platform and image yaml data"""

# Create the top-level parser
parser = DockerfileArgParser(
description="Generate the 'Dockerfile's for the base docker images")
parser.set()
args = parser.parse(argv)

# Read platform params
with open(args.platform, 'r') as f:
# use safe_load instead load
platform = yaml.safe_load(f)['platform']

# Read image params using platform params
images_yaml = StringIO()
try:
interpreter = Interpreter(output=images_yaml)
interpreter.file(open(args.images, 'r'), locals=platform)
images_yaml = images_yaml.getvalue()
except Exception as e:
print("Error processing %s" % args.images)
raise
finally:
interpreter.shutdown()
interpreter = None
# Use ordered dict
images = OrderedLoad(images_yaml, yaml.SafeLoader)['images']

# For each image tag
for image in images:

# Get data for image
data = dict(images[image])
data['tag_name'] = image

# Add platform params
data.update(platform)

# Apply package distro/version formatting
expandPackages(data)

# Get path to save Docker file
dockerfile_dir = os.path.join(args.output, image)
if not os.path.exists(dockerfile_dir):
os.makedirs(dockerfile_dir)
data['dockerfile_dir'] = dockerfile_dir

# generate Dockerfile
create_files(data)

if __name__ == '__main__':
main()
Loading