Skip to content

Commit

Permalink
Add gnocchi-container Github Action
Browse files Browse the repository at this point in the history
This action takes the Dockerfile from ci-tools
and updates it to run on Ubuntu 20.04

The action creates the container on each run but
after we have migrated away DockerHub to this Dockerfile
and archived ci-tools repo we can use the "container"
directive on workflows to pull the image from there
instead of building it on each run.
  • Loading branch information
tobias-urdin committed Jul 4, 2021
1 parent c41922e commit 38e1594
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/actions/gnocchi-container/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
FROM ubuntu:20.04
ENV GNOCCHI_WORKSPACE /github/workspace
ENV DEBIAN_FRONTEND noninteractive

#NOTE(tobias-urdin): need gnupg for apt-key
RUN apt-get update -y && apt-get install -qy gnupg
RUN echo 'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal main' >> /etc/apt/sources.list
RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F23C5A6CF475977595C89F51BA6932366A755776
RUN apt-get update -y && apt-get install -qy \
locales \
git \
wget \
curl \
nodejs \
npm \
python3 \
python3-dev \
python3-pip \
python3.6 \
python3.6-dev \
# Needed for uwsgi core routing support
build-essential \
libffi-dev \
libpq-dev \
postgresql \
memcached \
mysql-client \
mysql-server \
# For Ceph
librados-dev \
liberasurecode-dev \
python3-rados \
ceph \
# For prometheus
libsnappy-dev \
libprotobuf-dev \
# For redis
redis-server \
&& rm -rf /var/lib/apt/lists/*

#NOTE(sileht): really no utf-8 in 2017 !?
ENV LANG en_US.UTF-8
RUN update-locale
RUN locale-gen $LANG

#NOTE(sileht): Upgrade python dev tools
RUN python3 -m pip install -U pip tox virtualenv
RUN python3.6 -m pip install -U pip tox virtualenv

RUN npm install [email protected] --global

RUN groupadd --gid 1001 tester
RUN useradd --uid 1001 --gid 1001 --home-dir $GNOCCHI_WORKSPACE --shell /bin/bash tester
USER tester

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
12 changes: 12 additions & 0 deletions .github/actions/gnocchi-container/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Gnocchi Container'
description: 'Run command inside Gnocchi Container'
author: 'Tobias Urdin'
inputs:
command:
description: 'Command to run'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.command }}
2 changes: 2 additions & 0 deletions .github/actions/gnocchi-container/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
$@

0 comments on commit 38e1594

Please sign in to comment.