-
Notifications
You must be signed in to change notification settings - Fork 100
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
Split front-end and back-end containers #173
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
FROM manageiq/manageiq-pods:backend-latest | ||
MAINTAINER ManageIQ https://github.com/ManageIQ/manageiq-appliance-build | ||
|
||
## Set build ARGs | ||
ARG REF=master | ||
|
||
## Set ENV, LANG only needed if building with docker-1.8 | ||
ENV SUI_ROOT=/opt/manageiq/manageiq-ui-service | ||
|
||
## Atomic/OpenShift Labels | ||
LABEL name="manageiq" \ | ||
vendor="ManageIQ" \ | ||
version="Master" \ | ||
release=${REF} \ | ||
url="http://manageiq.org/" \ | ||
summary="ManageIQ appliance image" \ | ||
description="ManageIQ is a management and automation platform for virtual, private, and hybrid cloud infrastructures." \ | ||
io.k8s.display-name="ManageIQ" \ | ||
io.k8s.description="ManageIQ is a management and automation platform for virtual, private, and hybrid cloud infrastructures." \ | ||
io.openshift.expose-services="443:https" \ | ||
io.openshift.tags="ManageIQ,miq,manageiq" | ||
|
||
## Install EPEL repo, yum necessary packages for the build without docs, clean all caches | ||
RUN yum -y install centos-release-scl-rh && \ | ||
yum -y install --setopt=tsflags=nodocs \ | ||
httpd \ | ||
mod_auth_kerb \ | ||
mod_authnz_pam \ | ||
mod_intercept_form_submit \ | ||
mod_lookup_identity \ | ||
mod_ssl \ | ||
&& \ | ||
yum clean all | ||
|
||
## GIT clone manageiq-appliance and service UI repo (SUI) | ||
RUN mkdir -p ${SUI_ROOT} && \ | ||
curl -L https://github.com/ManageIQ/manageiq-ui-service/tarball/${REF} | tar vxz -C ${SUI_ROOT} --strip 1 | ||
|
||
## Setup environment | ||
RUN 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 | ||
|
||
## Change workdir to application root, build/install gems | ||
WORKDIR ${APP_ROOT} | ||
RUN source /etc/default/evm && \ | ||
export RAILS_USE_MEMORY_STORE="true" && \ | ||
rake update:bower && \ | ||
bin/rails log:clear tmp:clear && \ | ||
rake evm:compile_assets && \ | ||
# Cleanup install artifacts | ||
npm cache clean && \ | ||
bower cache clean && \ | ||
rm -rvf ${APP_ROOT}/tmp/cache/assets && \ | ||
rm -vf ${APP_ROOT}/log/*.log | ||
|
||
## Build SUI | ||
RUN source /etc/default/evm && \ | ||
cd ${SUI_ROOT} && \ | ||
yarn install --production && \ | ||
yarn run build && \ | ||
yarn cache clean | ||
|
||
## Expose required container ports | ||
EXPOSE 80 443 | ||
|
||
COPY docker-assets/check-dependent-services.sh /bin | ||
|
||
ENTRYPOINT ["/usr/local/bin/dumb-init", "--single-child", "--"] | ||
CMD ["entrypoint"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
# Source OpenShift scripting env | ||
[[ -s ${CONTAINER_SCRIPTS_ROOT}/container-deploy-common.sh ]] && source "${CONTAINER_SCRIPTS_ROOT}/container-deploy-common.sh" | ||
|
||
# Check readiness of external services | ||
check_svc_status ${MEMCACHED_SERVICE_NAME} 11211 | ||
check_svc_status ${DATABASE_SERVICE_NAME} 5432 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
# Source OpenShift scripting env | ||
[[ -s ${CONTAINER_SCRIPTS_ROOT}/container-deploy-common.sh ]] && source "${CONTAINER_SCRIPTS_ROOT}/container-deploy-common.sh" | ||
|
||
# Check readiness of external services | ||
check_svc_status ${FRONTEND_SERVICE_NAME} 80 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,7 +107,7 @@ objects: | |
spec: | ||
containers: | ||
- name: manageiq | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we also want to change this dc and container to be named There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so. I don't want to give it a name that suggests it is limited to only serving the UI / API / WS roles. |
||
image: "${APPLICATION_IMG_NAME}:${APPLICATION_IMG_TAG}" | ||
image: "${APPLICATION_IMG_NAME}:${FRONTEND_APPLICATION_IMG_TAG}" | ||
livenessProbe: | ||
tcpSocket: | ||
port: 443 | ||
|
@@ -192,6 +192,97 @@ objects: | |
resources: | ||
requests: | ||
storage: "${APPLICATION_VOLUME_CAPACITY}" | ||
|
||
|
||
- apiVersion: apps/v1beta1 | ||
kind: "StatefulSet" | ||
metadata: | ||
name: ${NAME}-backend | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is user-visible. Is "backend" something they would understand? Maybe "engine"? I don't know what would be the best name here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "engine" to me suggests that it is a required service, I don't have any better suggestions either. |
||
annotations: | ||
description: "Defines how to deploy the ManageIQ appliance" | ||
spec: | ||
replicas: 0 | ||
template: | ||
metadata: | ||
labels: | ||
name: ${NAME}-backend | ||
name: ${NAME}-backend | ||
spec: | ||
containers: | ||
- name: manageiq | ||
image: "${APPLICATION_IMG_NAME}:${BACKEND_APPLICATION_IMG_TAG}" | ||
livenessProbe: | ||
exec: | ||
command: | ||
- pidof | ||
- "MIQ Server" | ||
initialDelaySeconds: 480 | ||
volumeMounts: | ||
- | ||
name: "${NAME}-server" | ||
mountPath: "/persistent" | ||
env: | ||
- | ||
name: "APPLICATION_INIT_DELAY" | ||
value: "${APPLICATION_INIT_DELAY}" | ||
- | ||
name: "DATABASE_URL" | ||
valueFrom: | ||
secretKeyRef: | ||
name: "${NAME}-secrets" | ||
key: "database-url" | ||
- | ||
name: "MIQ_SERVER_DEFAULT_ROLES" | ||
value: "database_operations,event,reporting,scheduler,smartstate,ems_operations,ems_inventory,automate" | ||
- | ||
name: "FRONTEND_SERVICE_NAME" | ||
value: "${NAME}" | ||
- | ||
name: "MEMCACHED_SERVER" | ||
value: "${MEMCACHED_SERVICE_NAME}:11211" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this in the backend? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I'm not sure. |
||
- | ||
name: "V2_KEY" | ||
valueFrom: | ||
secretKeyRef: | ||
name: "${NAME}-secrets" | ||
key: "v2-key" | ||
- | ||
name: "ANSIBLE_SERVICE_NAME" | ||
value: "${ANSIBLE_SERVICE_NAME}" | ||
- | ||
name: "ANSIBLE_ADMIN_PASSWORD" | ||
valueFrom: | ||
secretKeyRef: | ||
name: "${ANSIBLE_SERVICE_NAME}-secrets" | ||
key: "admin-password" | ||
resources: | ||
requests: | ||
memory: "${APPLICATION_MEM_REQ}" | ||
cpu: "${APPLICATION_CPU_REQ}" | ||
limits: | ||
memory: "${APPLICATION_MEM_LIMIT}" | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: | ||
- /opt/manageiq/container-scripts/sync-pv-data | ||
serviceAccount: miq-anyuid | ||
serviceAccountName: miq-anyuid | ||
terminationGracePeriodSeconds: 90 | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: "${NAME}-backend-server" | ||
annotations: | ||
# Uncomment this if using dynamic volume provisioning. | ||
# https://docs.openshift.org/latest/install_config/persistent_storage/dynamically_provisioning_pvs.html | ||
# volume.alpha.kubernetes.io/storage-class: anything | ||
spec: | ||
accessModes: [ ReadWriteOnce ] | ||
resources: | ||
requests: | ||
storage: "${APPLICATION_VOLUME_CAPACITY}" | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bonus whitespace? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been adding a break between some of these things for readability There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These files are impossible |
||
- apiVersion: v1 | ||
kind: "Service" | ||
metadata: | ||
|
@@ -672,10 +763,15 @@ parameters: | |
description: "This is the Application image name requested to deploy." | ||
value: "docker.io/manageiq/manageiq-pods" | ||
- | ||
name: "APPLICATION_IMG_TAG" | ||
displayName: "Application Image Tag" | ||
description: "This is the Application image tag/version requested to deploy." | ||
value: "app-latest" | ||
name: "FRONTEND_APPLICATION_IMG_TAG" | ||
displayName: "Front end Application Image Tag" | ||
description: "This is the ManageIQ Frontend Application image tag/version requested to deploy." | ||
value: "frontend-latest" | ||
- | ||
name: "BACKEND_APPLICATION_IMG_TAG" | ||
displayName: "Back end Application Image Tag" | ||
description: "This is the ManageIQ Backend Application image tag/version requested to deploy." | ||
value: "backend-latest" | ||
- | ||
name: "ANSIBLE_IMG_NAME" | ||
displayName: "Ansible Image Name" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this stuff come out of the other Dockerfile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish, but
manageiq-ui-classic