-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from oracle/sprint-11
Sprint 11/v.0.13.0 Release
- Loading branch information
Showing
83 changed files
with
4,415 additions
and
653 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,5 +35,6 @@ containers/.oci | |
|
||
containers/oci/* | ||
!containers/oci/example_config | ||
!containers/cloud | ||
|
||
!okitweb/static/model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
# Copyright (c) 2020, Oracle and/or its affiliates. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. | ||
|
||
FROM oraclelinux:7-slim | ||
LABEL "provider"="Oracle" \ | ||
"issues"="https://github.com/oracle/oci-designer-toolkit/issues" \ | ||
"version"="0.13.0" \ | ||
"description"="OKIT Web Server Container." \ | ||
"copyright"="Copyright (c) 2020, Oracle and/or its affiliates." | ||
SHELL ["/bin/bash", "-c"] | ||
ENV PYTHONIOENCODING=utf8 \ | ||
PYTHONPATH=":/okit/visualiser:/okit/okitweb:/okit" \ | ||
FLASK_APP=okitweb \ | ||
FLASK_DEBUG=1 \ | ||
LANG=en_GB.UTF-8 \ | ||
LANGUAGE=en_GB:en \ | ||
LC_ALL=en_GB.UTF-8 \ | ||
PATH=/root/bin:${PATH} | ||
# Expose Ports | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
# Copy source code | ||
COPY containers/oci/* /root/.oci/ | ||
COPY containers/docker/run-server.sh /root/bin/ | ||
# Install new yum repos | ||
RUN yum install -y \ | ||
oracle-softwarecollection-release-el7 \ | ||
oraclelinux-developer-release-el7 \ | ||
# Disable oci config repo | ||
&& yum-config-manager --disable ol7_ociyum_config \ | ||
# Update base image | ||
&& yum update -y \ | ||
# Install additional packages | ||
&& yum install -y \ | ||
git \ | ||
python36 \ | ||
python3-pip \ | ||
&& rm -rf /var/cache/yum \ | ||
# Upgrade pip | ||
&& python3 -m pip install --upgrade pip==20.0.2 \ | ||
# Install required python modules | ||
&& pip3 install --no-cache-dir \ | ||
flask==1.1.1 \ | ||
gunicorn==20.0.4 \ | ||
oci==2.22.0 \ | ||
pandas==1.1.2 \ | ||
python-magic==0.4.18 \ | ||
pyyaml==5.2 \ | ||
requests==2.24.0 \ | ||
xlsxwriter==1.3.6 \ | ||
# Create Workspace | ||
&& mkdir -p /github \ | ||
&& git clone https://github.com/oracle/oci-designer-toolkit.git /github/oci-designer-toolkit \ | ||
&& mkdir -p /okit/{log,workspace} \ | ||
&& ln -sv /github/oci-designer-toolkit/okitweb /okit/okitweb \ | ||
&& ln -sv /github/oci-designer-toolkit/visualiser /okit/visualiser \ | ||
&& mkdir -p /okit/okitweb/static/okit/templates \ | ||
&& ln -sv /okit/templates /okit/okitweb/static/okit/templates/user \ | ||
&& chmod a+x /root/bin/run-server.sh | ||
# Add entrypoint to automatically start webserver | ||
CMD ["run-server.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#cloud-config | ||
write_files: | ||
# Add aliases to bash (Note: At time of writing the append flag does not appear to be working) | ||
- path: /etc/.bashrc | ||
append: true | ||
content: | | ||
alias lh='ls -lash' | ||
alias lt='ls -last' | ||
alias env='/usr/bin/env | sort' | ||
runcmd: | ||
# Install Required Packages because the packages section may not complete before the runcmd | ||
- sudo bash -c "yum install -y git python-oci-cli oci-utils" | ||
# Install Required Python Modules | ||
- sudo bash -c "pip3 install --no-cache-dir flask==1.1.1 gunicorn==20.0.4 oci==2.22.0 oci-cli==2.14.1 pandas==1.1.2 python-magic==0.4.18 pyyaml==5.2 requests==2.24.0 xlsxwriter==1.3.6" | ||
# Clone OKIT | ||
- sudo bash -c "git clone -b master --depth 1 https://github.com/oracle/oci-designer-toolkit.git /okit" | ||
- sudo bash -c "mkdir /okit/{log,workspace}" | ||
# Add additional environment information because append does not appear to work in write_file | ||
- sudo bash -c "echo 'source /etc/.bashrc' >> /etc/bashrc" | ||
- sudo bash -c "echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc" | ||
- sudo bash -c "echo 'export OKIT_VM_COMPARTMENT=`oci-metadata -g "compartmentID" --value-only`' >> /etc/bashrc" | ||
# Copy GUnicorn Service File | ||
- sudo bash -c 'sed "s/{COMPARTMENT_OCID}/`oci-metadata -g compartmentID --value-only`/" /okit/containers/services/gunicorn.service > /etc/systemd/system/gunicorn.service' | ||
# Enable Gunicorn Service | ||
- sudo systemctl enable gunicorn.service | ||
- sudo systemctl start gunicorn.service | ||
|
||
final_message: "**** The system is finally up, after $UPTIME seconds ****" |
Oops, something went wrong.