Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: hadolint
run: docker run --rm -i hadolint/hadolint < Dockerfile
- name: hadolint for controller
run: docker run --rm -i hadolint/hadolint < controller/Dockerfile
- name: hadolint for compute
run: docker run --rm -i hadolint/hadolint < compute/Dockerfile
test:
runs-on: ubuntu-20.04
steps:
Expand All @@ -18,4 +20,4 @@ jobs:
- name: Exec OpenStack CLI
run: |
docker-compose logs -t --tail=100
docker-compose exec -T --user stack devstack /bin/bash -c 'source devstack/openrc admin admin; openstack compute service list'
docker-compose exec -T --user stack controller /bin/bash -c 'source devstack/openrc admin admin; openstack compute service list'
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ This will take about 30 minutes.
$ sudo docker-compose up -d

$ sudo docker-compose logs -f
devstack_1 | This is your host IP address: 172.28.0.2
devstack_1 | Horizon is now available at http://172.28.0.2/dashboard
devstack_1 | Keystone is serving at http://172.28.0.2/identity/
devstack_1 | The default users are: admin and demo
devstack_1 | The password: nomoresecret
devstack_1 |
devstack_1 | Services are running under systemd unit files.
devstack_1 | For more information see:
devstack_1 | https://docs.openstack.org/devstack/latest/systemd.html
devstack_1 |
devstack_1 | DevStack Version: wallaby
devstack_1 | Change:
devstack_1 | OS Version: Ubuntu 20.04 focal
controller | This is your host IP address: 172.28.0.2
controller | Horizon is now available at http://172.28.0.2/dashboard
controller | Keystone is serving at http://172.28.0.2/identity/
controller | The default users are: admin and demo
controller | The password: nomoresecret
controller |
controller | Services are running under systemd unit files.
controller | For more information see:
controller | https://docs.openstack.org/devstack/latest/systemd.html
controller |
controller | DevStack Version: wallaby
controller | Change:
controller | OS Version: Ubuntu 20.04 focal
```

You can use the OpenStack CLI in the container.

```bash
$ sudo docker-compose exec \
--user stack \
devstack \
controller \
/bin/bash -c 'source devstack/openrc admin admin; exec /bin/bash'

stack@538b06c0fc0b:~$ openstack endpoint list
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile → compute/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ RUN apt-get update \
iproute2=5.5.0-1ubuntu1 \
lsb=11.1.0ubuntu2 \
git=1:2.25.1-1ubuntu3.1 \
curl=7.68.0-1ubuntu2.5 \
init=1.57 \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /bin/wait-for-it.sh \
&& chmod a+x /bin/wait-for-it.sh

RUN useradd -s /bin/bash -d /opt/stack -m stack \
&& mkdir -p /etc/sudoers.d/ \
Expand All @@ -26,8 +29,8 @@ RUN git clone https://github.com/openstack/devstack.git \
&& git -C ./devstack checkout $DEVSTACK_COMMIT \
&& chown -R stack:stack ./devstack

COPY local.conf /opt/stack/devstack/
COPY devstack.service /etc/systemd/system/
COPY compute/local.conf /opt/stack/devstack/
COPY compute/devstack.service /etc/systemd/system/
COPY 0001-devstack-disable-ovs.patch /opt/stack/

RUN patch -d ./devstack -p1 < 0001-devstack-disable-ovs.patch
Expand Down
14 changes: 14 additions & 0 deletions compute/devstack.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=devstack

[Service]
User=stack
Type=oneshot
ExecStartPre=/bin/wait-for-it.sh -h 172.28.0.2 -p 80 -t 3600
ExecStart=/opt/stack/devstack/stack.sh
ExecReload = /usr/bin/kill -HUP $MAINPID
KillMode = process
StandardOutput=tty

[Install]
WantedBy=multi-user.target
19 changes: 19 additions & 0 deletions compute/local.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[[local|localrc]]
ADMIN_PASSWORD=nomoresecret
DATABASE_PASSWORD=stackdb
RABBIT_PASSWORD=stackqueue
SERVICE_PASSWORD=$ADMIN_PASSWORD
LOGFILE=$DEST/logs/stack.sh.log
LOGDAYS=2
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
SWIFT_DATA_DIR=$DEST/data

ENABLED_SERVICES=n-cpu,placement-client

SERVICE_HOST=172.28.0.2
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
GLANCE_HOSTPORT=$SERVICE_HOST:9292

[[post-config|$NOVA_CONF]]
40 changes: 40 additions & 0 deletions controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ubuntu:20.04

EXPOSE 80 5000 8773 8774 8775 8776 9292
ENV DEBIAN_FRONTEND=noninteractive
ENV DEVSTACK_COMMIT=83821a11ac1d6738b63cb10878b8aaa02e153374

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates=20210119~20.04.1 \
patch=2.7.6-6 \
systemd=245.4-4ubuntu3.5 \
sudo=1.8.31-1ubuntu1.2 \
iproute2=5.5.0-1ubuntu1 \
lsb=11.1.0ubuntu2 \
git=1:2.25.1-1ubuntu3.1 \
curl=7.68.0-1ubuntu2.5 \
init=1.57 \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /bin/wait-for-it.sh \
&& chmod a+x /bin/wait-for-it.sh

RUN useradd -s /bin/bash -d /opt/stack -m stack \
&& mkdir -p /etc/sudoers.d/ \
&& echo "stack ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/stack

WORKDIR /opt/stack
RUN git clone https://github.com/openstack/devstack.git \
&& git -C ./devstack checkout $DEVSTACK_COMMIT \
&& chown -R stack:stack ./devstack

COPY controller/local.conf /opt/stack/devstack/
COPY controller/devstack.service /etc/systemd/system/
COPY 0001-devstack-disable-ovs.patch /opt/stack/

RUN patch -d ./devstack -p1 < 0001-devstack-disable-ovs.patch
RUN systemctl enable devstack

STOPSIGNAL SIGRTMIN+3
CMD [ "/sbin/init" ]
File renamed without changes.
2 changes: 1 addition & 1 deletion local.conf → controller/local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SWIFT_REPLICAS=1
SWIFT_DATA_DIR=$DEST/data

ENABLED_SERVICES=rabbit,mysql,key
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,placement-api,placement-client
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cond,n-sch,placement-api,placement-client
ENABLED_SERVICES+=,g-api,g-reg
ENABLED_SERVICES+=,horizon

Expand Down
40 changes: 38 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
version: '3'
services:
devstack:
build: .
controller:
container_name: controller
hostname: controller
build:
context: .
dockerfile: controller/Dockerfile
privileged: true
tty: true
networks:
management_network:
ipv4_address: 172.28.0.2
compute-1:
container_name: compute-1
hostname: compute-1
build:
context: .
dockerfile: compute/Dockerfile
privileged: true
tty: true
networks:
management_network:
ipv4_address: 172.28.0.3
compute-2:
container_name: compute-2
hostname: compute-2
build:
context: .
dockerfile: compute/Dockerfile
privileged: true
tty: true
networks:
management_network:
ipv4_address: 172.28.0.4
networks:
management_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.28.0.0/24