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

Base monolithic container image on pods ui worker #19463

Merged
merged 1 commit into from
Nov 6, 2019
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
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG IMAGE_REF=latest
FROM manageiq/manageiq-pods:frontend-${IMAGE_REF}
FROM manageiq/manageiq-ui-worker:${IMAGE_REF}
MAINTAINER ManageIQ https://github.com/ManageIQ/manageiq

## Set build ARG
Expand All @@ -18,6 +18,7 @@ RUN yum -y install --setopt=tsflags=nodocs \
yum clean all

VOLUME [ "/var/lib/pgsql/data" ]
VOLUME [ ${APP_ROOT} ]

# Initialize SSH
RUN ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \
Expand All @@ -34,8 +35,8 @@ RUN ${APPLIANCE_ROOT}/setup && \
mv /etc/httpd/conf.d/ssl.conf{,.orig} && \
echo "# This file intentionally left blank. ManageIQ maintains its own SSL configuration" > /etc/httpd/conf.d/ssl.conf

## Copy appliance-initialize script and service unit file
COPY docker-assets/appliance-initialize.sh /usr/bin
## Overwrite entrypoint from pods repo
COPY docker-assets/entrypoint /usr/local/bin

EXPOSE 443 22

Expand Down
3 changes: 0 additions & 3 deletions docker-assets/check-dependent-services.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
#!/bin/bash

# Source EVM environment
/usr/sbin/crond &

# Check if memcached is running, if not start it
pidof memcached
test $? -ne 0 && /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 -l 127.0.0.1 -d

# Source EVM environment
[ -f /etc/default/evm ] && . /etc/default/evm
[[ -s ${CONTAINER_SCRIPTS_ROOT}/container-deploy-common.sh ]] && source "${CONTAINER_SCRIPTS_ROOT}/container-deploy-common.sh"

function create_v2_key() {
V2_KEY=$(ruby -ropenssl -rbase64 -e 'puts Base64.strict_encode64(Digest::SHA256.digest(OpenSSL::Random.random_bytes(32))[0, 32])')
write_v2_key
cat > /var/www/miq/vmdb/certs/v2_key << KEY
---
:algorithm: aes-256-cbc
:key: ${V2_KEY}
KEY
unset V2_KEY
}

Expand All @@ -17,7 +26,12 @@ echo "== Checking MIQ database status =="
[[ -d /var/lib/pgsql/data/base ]]
if [ $? -eq 0 ]; then
echo "** DB already initialized"
exit 0
echo "** Starting postgresql"

su postgres -c "pg_ctl -D ${APPLIANCE_PG_DATA} start"
test $? -ne 0 && echo "!! Failed to start postgresql service" && exit 1

bundle exec rake db:migrate
else
echo "** DB has not been initialized"

Expand All @@ -35,10 +49,6 @@ else
su postgres -c "psql -c \"CREATE ROLE root SUPERUSER LOGIN PASSWORD 'smartvm'\""
test $? -ne 0 && echo "!! Failed to inject MIQ root Role" && exit 1

# Check if memcached is running, if not start it
pidof memcached
test $? -ne 0 && /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 -l 127.0.0.1 -d

echo "** Starting DB setup"
pushd ${APP_ROOT}
create_v2_key
Expand All @@ -48,5 +58,8 @@ else
echo "** MIQ database has been initialized"

generate_miq_server_cert.sh
exit 0
fi

rm -f /var/www/miq/vmdb/tmp/pids/evm.pid

exec ruby /var/www/miq/vmdb/lib/workers/bin/evm_server.rb