Skip to content

Commit

Permalink
Merge pull request #36 from oracle/sprint-5/v0.7.0/200624
Browse files Browse the repository at this point in the history
Sprint 5/v0.7.0/200624
  • Loading branch information
toxophilist authored Jun 24, 2020
2 parents f7005a8 + c910fdb commit 5ca3d86
Show file tree
Hide file tree
Showing 154 changed files with 4,850 additions and 1,374 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Files / Directories to ignore during the Docker Build

.git
.idea
.scannerwork
documentation
log
*.md
*.txt
*.properties
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ config/
containers/.oci
**/*.pem

containers/oci/*
!containers/oci/example_config
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Release Notes


## Version 0.7.0
**Release Date**: 24th June 2020
### Features
1. Windows PowerShell Docker Helper Scripts.
2. Add setting for last selected Region and Compartment for Query and Resource Manager Export.
3. Modify Resource Manager dialog to close when the stack has been created and display progress bar during creation.
4. Specify stack name during export to Resource Manager
5. Update existing Resource Manager Stacks
6. When Creating Security List / Route Table modify the Default for the Security List / Route Table rather than create.
7. First implementation of simple json validation and display of results. This can be manually executed or will be automatically execute during export to Terraform, Ansible or Resource Manager and only when successful will this be allowed.
8. Hub & Spoke Network Topology Reference Architecture.
9. Enable Bare Metal Shapes.

### Bug Fixes
1. Service Gateway with null route_table_id will not generate Terraform / Ansible / RM. Route table values can not be assigned within the GUI.
2. Dynamic Routing Gateway assigning the VCN Id to Compartment Id (OKIT-73).
3. Defined Tags not generating correctly for Terraform.
4. Terraform being generated with invalid characters (OKIT-84).


## Version 0.6.0
**Release Date**: 3rd June 2020
### Features
Expand All @@ -15,6 +35,7 @@
7. Move DRG to VCN Parent rather than Compartment
8. Check for Update
9. Highlight selected artefact (Toggles on/off).
10. Database Systems

### Bug Fixes
1. Palette did not scroll
Expand Down
26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OCI Designer Toolkit [0.6.0](CHANGELOG.md#version-0.6.0)
# OCI Designer Toolkit [0.7.0](CHANGELOG.md#version-0.7.0)

OCI designer toolKIT (OKIT) is a set of tools for enabling design, deploy and visualise OCI environments
through a graphical web based interface.
Expand Down Expand Up @@ -28,29 +28,15 @@ web interface, to provide a portable generic, json, file that can be used to vis
Detailed OKIT Installation steps can be found in the [OCI Designer Toolkit Installation Guide](documentation/Installation.md).

### Quick Start
The docker image is the recommended runtime server and can be built and started using the following simple docker commands.
The docker image is the recommended runtime server OKIT provides a simple Docker Compose script to build and start the container.

#### Build Docker Image
```bash
cd oci-designer-toolkit
docker build --tag okit --file ./containers/docker/Dockerfile --force-rm ./containers/docker/
cd oci-designer-toolkit/containers/docker
docker-compose up
```

#### Start Docker Image
- OKIT_ROOT_DIR : Absolute directory name for the extracted / cloned OKIT repository
- OCI_CONFIG_DIR : Directory containing the OCI config file. Details can be found in [OCI Designer Toolkit Installation Guide](documentation/Installation.md#oci-config-file).

```bash
cd oci-designer-toolkit
docker run -d --rm -p 80:80 \
--name okit \
--hostname okit \
-v <OCI_CONFIG_DIR>:/root/.oci \
-v <OKIT_ROOT_DIR>/okitweb:/okit/okitweb \
-v <OKIT_ROOT_DIR>/visualiser:/okit/visualiser \
-v <OKIT_ROOT_DIR>/log:/okit/log \
okit
```
__*Note:*__ For full connection to OCI you will need to follow the [Installation Create Config File instruction](documentation/Installation.md#oci-config-file)
prior to building.

Once started the Designer BUI can be accessed on [http://localhost/okit/designer](http://localhost/okit/designer)

Expand Down
8 changes: 6 additions & 2 deletions containers/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
FROM oraclelinux:7-slim
LABEL "provider"="Oracle" \
"issues"="https://github.com/oracle/oci-designer-toolkit/issues" \
"version"="0.6.0" \
"version"="0.7.0" \
"description"="OKIT Web Server Container." \
"copyright"="Copyright (c) 2020, Oracle and/or its affiliates."
SHELL ["/bin/bash", "-c"]
Expand Down Expand Up @@ -46,7 +46,11 @@ RUN yum install -y \
cryptography==2.8 \
# Create Workspace
&& mkdir -p /okit/{config,log,visualiser,okitweb,workspace}
# Copy source code
COPY okitweb /okit/okitweb
COPY visualiser /okit/visualiser
COPY containers/oci/* /root/.oci/
# Add entrypoint to automatically start webserver
#ENTRYPOINT gunicorn --workers=2 --limit-request-line 0 --bind=0.0.0.0:80 okitweb.wsgi:app
ENTRYPOINT ["gunicorn"]
CMD ["--workers=2", "--limit-request-line", "0", "--bind=0.0.0.0:80", "okitweb.wsgi:app"]
CMD ["--workers=4", "--limit-request-line", "0", "--timeout", "120", "--bind=0.0.0.0:80", "okitweb.wsgi:app"]
16 changes: 16 additions & 0 deletions containers/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# file: docker-compose
# 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.
version: '3.8'
services:
okit:
build:
context: ../../
dockerfile: ./containers/docker/Dockerfile
image: okit
container_name: okit
ports:
- 443:443/tcp
- 80:80/tcp
...
File renamed without changes.
11 changes: 11 additions & 0 deletions containers/scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Helper Scripts

- build-docker-image.sh
- build_docker_image_win.ps1
- start-okit-server.sh
- start_okit_server_win.ps1

## build-docker-image.sh
## build_docker_image_win.ps1
## start-okit-server.sh
## start_okit_server_win.ps1
7 changes: 5 additions & 2 deletions containers/scripts/build-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# 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.

export ROOT_DIR=$(cd $(dirname $0)/../..; pwd)

docker kill okit
docker rmi okit

echo "*******************************************************************"
Expand All @@ -13,9 +16,9 @@ echo "*******************************************************************"

docker build \
--tag okit \
--file ../docker/Dockerfile \
--file ${ROOT_DIR}/containers/docker/Dockerfile \
--force-rm \
../docker/
${ROOT_DIR}

for dangling in $(docker images -f "dangling=true" -q)
do
Expand Down
3 changes: 3 additions & 0 deletions containers/scripts/build_docker_image_win.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

# 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.

#Create Docker Image on Windows without sh shell installed

Clear-Host
Expand Down
6 changes: 1 addition & 5 deletions containers/scripts/start-okit-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@

export ROOT_DIR=$(cd $(dirname $0)/../..; pwd)

docker run -d --rm -p 80:80 \
docker run -d --rm -p 443:443 -p 80:80 \
--name okit \
--hostname okit \
-v ~/.oci:/root/.oci:Z \
-v ${ROOT_DIR}/okitweb:/okit/okitweb:Z \
-v ${ROOT_DIR}/visualiser:/okit/visualiser:Z \
-v ${ROOT_DIR}/log:/okit/log:Z \
okit
6 changes: 4 additions & 2 deletions containers/scripts/start_okit_server_win.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

# 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.

#Start Docker image on windows
#Assuming that OCI CLI it's configured in default path - oci setup config

Expand Down Expand Up @@ -42,5 +45,4 @@ if (-not (Test-Path -LiteralPath $OciCliFolder))
}


& "docker" run --rm -it -p 443:443/tcp -p 80:80/tcp --hostname okit --name okit -v $ENV:UserProfile\.oci:/root/.oci:Z -v $Rootfolder\okitweb:/okit/okitweb:Z -v $Rootfolder\visualiser:/okit/visualiser:Z -v $Rootfolder\log:/okit/log:Z okit:latest

& "docker" run --rm -it -p 443:443/tcp -p 80:80/tcp --hostname okit --name okit -v $ENV:UserProfile\.oci:/root/.oci -v $Rootfolder\okitweb:/okit/okitweb -v $Rootfolder\visualiser:/okit/visualiser -v $Rootfolder\log:/okit/log okit:latest
14 changes: 9 additions & 5 deletions containers/vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box_url = "#{BOX_URL}/#{BOX_NAME}.json"
config.vm.define NAME

# This will expose the OKIT repo folder inside the VM under ~/okit-repo
config.vm.synced_folder "../../okitweb", "/okit/okitweb"
config.vm.synced_folder "../../visualiser", "/okit/visualiser"

# set cpu, memory size and vm name
config.vm.provider "virtualbox" do |v|
v.cpus = 1
Expand Down Expand Up @@ -51,6 +47,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Run external install script as root
config.vm.provision "shell", inline: "echo '============== Running privileged commands ============== '"
config.vm.provision "shell", inline: "mkdir -p /okit; chmod 777 /okit", privileged: true
config.vm.provision "file", source: "../../okitweb", destination: "/okit/okitweb"
config.vm.provision "file", source: "../../visualiser", destination: "/okit/visualiser"
config.vm.provision "file", source: "../oci", destination: "/okit/config"
config.vm.provision "shell", inline: "ln -s /okit/config /root/.oci", privileged: true
config.vm.provision "shell", inline: "chown -R root:root /root/.oci", privileged: true
config.vm.provision "shell", inline: "chmod 666 /root/.oci/*.pem", privileged: true
config.vm.provision "shell", path: "configure_software.sh", privileged: true
config.vm.provision "file", source: "nginx.conf", destination: "/tmp/nginx.conf"
config.vm.provision "file", source: "gunicorn.service", destination: "/tmp/gunicorn.service"
Expand All @@ -62,9 +65,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Run external install script as vagrant
config.vm.provision "shell", inline: "echo '************** Running vagrant user commands ************** '"
config.vm.provision "shell", inline: "mkdir -p /okit/{log,workspace}", privileged: false
config.vm.provision "shell", inline: "echo 'export PATH=/usr/local/bin:/opt/python/bin:${PATH}' >> /home/vagrant/.bash_profile", privileged: false
config.vm.provision "shell", inline: "echo 'export OCI_CONFIG_DIR=~/.oci' >> /home/vagrant/.bash_profile", privileged: false
config.vm.provision "shell", inline: "ln -s /vagrant/oci ~/.oci", privileged: false
config.vm.provision "shell", inline: "ln -s /okit/config ~/.oci", privileged: false
config.vm.provision "shell", inline: "echo '************** Finished vagrant user commands ************** '"

end
4 changes: 0 additions & 4 deletions containers/vagrant/configure_software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,3 @@ pip3 install \
pyyaml==5.2 \
werkzeug==0.16.0

# Create Directories
mkdir -p /okit/{config,visualiser,okitweb,workspace};
mkdir -p /home/vagrant/okit
chown -R vagrant:vagrant /home/vagrant/okit
2 changes: 1 addition & 1 deletion containers/vagrant/flask.service
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Environment="PYTHONPATH=:/okit/visualiser:/okit/okitweb:/okit"
Environment="FLASK_APP=okitweb"
Environment="FLASK_DEBUG=development"
RuntimeDirectory=flask
WorkingDirectory=/home/vagrant/okit
WorkingDirectory=/okit/workspace
ExecStart=/usr/bin/python3 -m flask run --host=0.0.0.0 --port=8080 --no-debugger
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
Expand Down
2 changes: 1 addition & 1 deletion containers/vagrant/gunicorn.service
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Group=vagrant
Environment="PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin"
Environment="PYTHONPATH=:/okit/visualiser:/okit/okitweb:/okit"
RuntimeDirectory=gunicorn
WorkingDirectory=/home/vagrant/okit
WorkingDirectory=/okit/workspace
ExecStart=/usr/local/bin/gunicorn okitweb.wsgi:app
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
Expand Down
6 changes: 3 additions & 3 deletions documentation/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ to the system.
- Backend
- **[Connection Facade](#connection-facade)** : [visualiser/facades/*ociConnection*.py](../visualiser/facades/ociConnection.py)
- **[Python OCI Query](#python-oci-query)** : [visualiser/common/*ociQuery*.py](../visualiser/common/ociQuery.py)
- **[Python Generator](#python-generator)** : [visualiser/generators/*ociGenerator*.py](../visualiser/generators/ociGenerator.py)
- **[Python Generator](#python-generator)** : [visualiser/generators/*ociGenerator*.py](../visualiser/generators/okitGenerator.py)

## Naming Convention
All files associated with an artifact will have file names based on the artifact. If we take the ***Block Storage Volume***
Expand Down Expand Up @@ -367,7 +367,7 @@ basic processing and provide the key "list" method to retrieve the artifacts dur

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = ["Andrew Hopkinson (Oracle Cloud Solutions A-Team)"]
__version__ = "1.0.0.0"
__version__ = "1.0.0"
__module__ = "ociBlockStorageVolumes"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

Expand All @@ -388,7 +388,7 @@ import re
import sys

from facades.ociConnection import OCIBlockStorageVolumeConnection
from common.ociLogging import getLogger
from common.okitLogging import getLogger

# Configure logging
logger = getLogger()
Expand Down
45 changes: 30 additions & 15 deletions documentation/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ python modules are installed and in addition provide a simple flask server that
## Table of Contents

1. [Clone Repository](#clone-repository)
2. [Docker](#docker)
2. [Docker Compose](#docker-compose)
3. [Docker](#docker)
1. [Build Docker Image](#build-docker-image)
2. [Start Docker Image](#start-docker-image)
3. [Vagrant](#vagrant)
4. [Vagrant](#vagrant)
1. [Prerequisites](#prerequisites)
2. [Copy the .oci folder](#copy-the-oci-folder)
3. [Build Vagrant Image](#build-vagrant-image)
Expand All @@ -21,17 +22,17 @@ python modules are installed and in addition provide a simple flask server that
## Clone Repository
Before the building either the Docker or Vagrant Images the project will nee to be cloned from the Git Repository (or downloaded)
and it is recommended that the latest Stable Release be cloned. The latest stable version number if shown in the README
and the associated Release tag is in the format vX.Y.Z hence for the version 0.6.0 the Release tag will be
**v0.6.0**. The command shows how this can be cloned to the local machine.
and the associated Release tag is in the format vX.Y.Z hence for the version 0.7.0 the Release tag will be
**v0.7.0**. The command shows how this can be cloned to the local machine.

```bash
git clone -b v0.6.0 --depth 1 git@github.com:oracle/oci-designer-toolkit.git
git clone -b v0.7.0 --depth 1 git@github.com:oracle/oci-designer-toolkit.git
```

or

```bash
git clone -b v0.6.0 --depth 1 https://github.com/oracle/oci-designer-toolkit.git
git clone -b v0.7.0 --depth 1 https://github.com/oracle/oci-designer-toolkit.git
```

### Download
Expand Down Expand Up @@ -68,34 +69,48 @@ Your pem key associated with your OCI Tenancy / Account should now be copied to
Further information on the config file can be found on the OCI sdk page [SDK and CLI Configuration File](https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm).


## Docker Compose
The docker image is the recommended runtime server OKIT provides a simple Docker Compose script to build and start the container.

```bash
cd oci-designer-toolkit/containers/docker
docker-compose up
```

## Docker
The docker image is the recommended runtime server and can be built and started using the scripts in the docker sub directory.
It should be noted that the current Docker script is designed for development purposes and mounts the source directories
at runtime.

- OKIT_ROOT_DIR : Absolute Root Directory of the extracted / cloned OKIT repository
- OCI_CONFIG_DIR : Directory containing the OCI config file (OKIT_ROOT_DIR/containers/oci)

### Build Docker Image
```bash
cd oci-designer-toolkit
docker build --tag okit --file ./containers/docker/Dockerfile --force-rm ./containers/docker/
docker build --tag okit --file ./containers/docker/Dockerfile --force-rm .
```

### Start Docker Image
The __<OKIT_ROOT_DIR>/containers/scripts__ contains helper scripts for Linux/Mac and Windows PowerShell.

- OKIT_ROOT_DIR : Absolute Root Directory of the extracted / cloned OKIT repository
- OCI_CONFIG_DIR : Directory containing the OCI config file (OKIT_ROOT_DIR/containers/oci)
- Linux/Mac : build-docker-image.sh
- Windows PowerShell : build_docker_image_win.ps1

### Start Docker Image

```bash
cd oci-designer-toolkit
docker run -d --rm -p 80:80 \
docker run -d --rm -p 443:443 -p 80:80 \
--name okit \
--hostname okit \
-v <OCI_CONFIG_DIR>:/root/.oci \
-v <OKIT_ROOT_DIR>/okitweb:/okit/okitweb \
-v <OKIT_ROOT_DIR>/visualiser:/okit/visualiser \
-v <OKIT_ROOT_DIR>/log:/okit/log \
okit
```

The __<OKIT_ROOT_DIR>/containers/scripts__ contains helper scripts for Linux/Mac and Windows PowerShell.

- Linux/Mac : start-okit-server.sh
- Windows PowerShell : start_okit_server_win.ps1

If you want to run the image in and interactive mode then replace to _-d_ in the above command with _-it_.


Expand Down
Loading

0 comments on commit 5ca3d86

Please sign in to comment.