Skip to content

Commit

Permalink
new upstream 4.17.2 (#15)
Browse files Browse the repository at this point in the history
* new upstream 4.17.2

* use quay.io

* Switch to new build process

* remove upgrade, be verbosy
  • Loading branch information
resmo authored Jan 25, 2023
1 parent 56bea49 commit 5fdebee
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 27 deletions.
41 changes: 25 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
FROM ubuntu:xenial-20181113
FROM quay.io/bedrock/ubuntu:22.04

MAINTAINER "René Moser" <[email protected]>
ENV DEBIAN_FRONTEND noninteractive

ARG src_url=https://github.com/apache/cloudstack/archive/4.13.1.0.tar.gz
ARG src_url=https://github.com/apache/cloudstack/archive/refs/tags/4.17.2.0.tar.gz

RUN echo 'mysql-server mysql-server/root_password password root' | debconf-set-selections; \
echo 'mysql-server mysql-server/root_password_again password root' | debconf-set-selections;

RUN apt-get -y update && apt-get dist-upgrade -y && apt-get install -y \
RUN apt-get -y update && apt-get install -y --no-install-recommends \
genisoimage \
libffi-dev \
libssl-dev \
sudo \
ipmitool \
maven \
netcat \
openjdk-8-jdk \
python-dev \
python-mysql.connector \
python-pip \
python-setuptools \
python-paramiko \
openjdk-11-jdk \
python3 \
python3-dev \
python3-mysql.connector \
python3-pip \
python3-setuptools \
python3-paramiko \
supervisor \
wget \
nginx \
jq \
mysql-server \
openssh-client \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*;
build-essential \
npm \
nodejs \
&& apt-get clean all && rm -rf /var/lib/apt/lists/*;


# TODO: check if and why this is needed
RUN mkdir -p /root/.ssh \
&& chmod 0700 /root/.ssh \
&& ssh-keygen -t rsa -N "" -f id_rsa.cloud

RUN mkdir -p /var/run/mysqld; \
chown mysql /var/run/mysqld; \
echo '''sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"''' >> /etc/mysql/mysql.conf.d/mysqld.cnf
chown mysql /var/run/mysqld;

RUN (/usr/bin/mysqld_safe &); sleep 5; mysqladmin -u root -proot password ''

Expand All @@ -47,24 +50,30 @@ RUN wget $src_url -O /opt/cloudstack.tar.gz; \

WORKDIR /opt/cloudstack

RUN ln -s /usr/bin/python3 /usr/local/bin/python
RUN mvn -Pdeveloper -Dsimulator -DskipTests clean install
RUN mvn -Pdeveloper -Dsimulator dependency:go-offline
RUN mvn -pl client jetty:run -Dsimulator -Djetty.skip -Dorg.eclipse.jetty.annotations.maxWait=120

COPY zones.cfg /opt/zones.cfg

RUN (/usr/bin/mysqld_safe &); \
sleep 5; \
mvn -Pdeveloper -pl developer -Ddeploydb; \
mvn -Pdeveloper -pl developer -Ddeploydb-simulator; \
mvn -Pdeveloper,marvin -pl :cloud-marvin; \
MARVIN_FILE=$(find /opt/cloudstack/tools/marvin/dist/ -name "Marvin*.tar.gz"); \
pip install wheel; \
pip install $MARVIN_FILE;

COPY zones.cfg /opt/zones.cfg
COPY nginx_default.conf /etc/nginx/sites-available/default
RUN pip install cs==2.5
RUN pip install cs
COPY run.sh /opt/run.sh
COPY deploy.sh /opt/deploy.sh
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

RUN cd ui && npm install && npm run build

RUN /opt/deploy.sh

EXPOSE 8888 8080 8096
Expand Down
73 changes: 67 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,73 @@
trigger:
- master
batch: true
branches:
include:
- main
- stable-*
tags:
include:
- '*'

pr:
- master
branches:
include:
- main
- stable-*

pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-22.04'

steps:
- script: docker build .
displayName: Build Container
variables:
container_name: "quay.io/ansible/$(System.TeamProject)"
scratchpad_tag: "quay.io/ansible/scratchpad:$(System.TeamProject)-$(Build.SourceBranchName)-$(Build.BuildId)"
python_version: '3.10'
containmint_version: '0.2.0'
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
push_or_no_login: --push
${{ else }}:
push_or_no_login: --no-login

stages:
- stage: Build
dependsOn: []
jobs:
- job: Arch
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python_version)'
displayName: Use Python
- script: pip install containmint==$(containmint_version) --disable-pip-version-check --user
displayName: Install containmint
- script: >
containmint build
--tag "$(scratchpad_tag)-$(System.JobName)"
--arch "$(System.JobName)"
$(push_or_no_login)
displayName: Build
env:
CONTAINMINT_PASSWORD: $(CONTAINMINT_PASSWORD)
strategy:
matrix:
x86_64: {}

- stage: Deploy
dependsOn: Build
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
jobs:
- job: Image
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python_version)'
displayName: Use Python
- script: pip install containmint==$(containmint_version) --disable-pip-version-check --user
displayName: Install containmint
- script: >
containmint merge
--push
--tag "$(container_name):$(Build.SourceBranchName)"
"$(scratchpad_tag)-x86_64"
displayName: Merge
env:
CONTAINMINT_PASSWORD: $(CONTAINMINT_PASSWORD)
3 changes: 1 addition & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ until nc -z localhost 8096; do
done

sleep 3
python /opt/cloudstack/tools/marvin/marvin/deployDataCenter.py -i /opt/zones.cfg
python3 /opt/cloudstack/tools/marvin/marvin/deployDataCenter.py -i /opt/zones.cfg

export CLOUDSTACK_ENDPOINT=http://127.0.0.1:8096
export CLOUDSTACK_KEY=dummy
export CLOUDSTACK_SECRET=dummy

# Add Simulator to supported hypervisors exclusively
cs updateConfiguration name=hypervisor.list value=Simulator

6 changes: 3 additions & 3 deletions nginx_default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ upstream cloudstack-backend {

server {
listen 8888 default_server;
server_name _;

root /var/www/html;

server_name _;

# waiting for zone to be deployed
if (!-f /var/www/html/admin.json) {
return 503;
Expand All @@ -18,6 +17,7 @@ server {
proxy_pass http://cloudstack-backend;
}
location / {

root /opt/cloudstack/ui/dist;
index index.html;
}
}

0 comments on commit 5fdebee

Please sign in to comment.