Skip to content

Commit

Permalink
Merge pull request #175 from oracle/sprint-12
Browse files Browse the repository at this point in the history
Sprint 12 Release
  • Loading branch information
toxophilist authored Nov 18, 2020
2 parents 66a6f29 + b415ca1 commit 64c4595
Show file tree
Hide file tree
Showing 101 changed files with 129,982 additions and 2,158 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Release Notes


## Version 0.14.0
**Release Date**: 18th November 2020
### Features
1. Add collapse / expand to container style artefacts Compartment / VCN / Subnet.
2. Implement updated, Oracle Standard, Look and Feel for diagram elements.
3. Add Preferences option to choose display label (Name / Resource / None) this will be displayed below the element on the SVG (Ehancement: #126).
4. Add OKIT specific "Definition" field to all artefacts to allow a free text definition of the artefact (Enhancement: #149).
5. Add preference to specify the type of tooltip to be displayed (Name / Definition / Summary) when hovering over elements in the diagram.
6. Add artefact element highlighting when the properties sheet is open. Moving the cursor over the properties sheet will highlight the associated artefact.
7. Implement simple Auto Save functionality to save model every 30 seconds to local storage (Enhancement: #169).
8. Generate Title & description for queried diagrams (Enhancement: #164).

### Bug Fixes
1. Fix issue where MySQL Databases could not be deleted.


## Version 0.13.0
**Release Date**: 28th October 2020
### Features
Expand Down
4 changes: 2 additions & 2 deletions 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.13.0" \
"version"="0.14.0" \
"description"="OKIT Web Server Container." \
"copyright"="Copyright (c) 2020, Oracle and/or its affiliates."
SHELL ["/bin/bash", "-c"]
Expand Down Expand Up @@ -38,7 +38,7 @@ RUN yum install -y \
python3-pip \
&& rm -rf /var/cache/yum \
# Upgrade pip
&& python3 -m pip install --upgrade pip==20.0.2 \
&& python3 -m pip install --upgrade pip \
# Install required python modules
&& pip3 install --no-cache-dir \
flask==1.1.1 \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Oracle Cloud Infrastructure Designer and Visualisation Toolkit [0.13.0](CHANGELOG.md#version-0.13.0)
# Oracle Cloud Infrastructure Designer and Visualisation Toolkit [0.14.0](CHANGELOG.md#version-0.14.0)

OCI designer and visualisation toolKIT (OKIT) is a browser based tool that allows the user to [design](https://www.ateam-oracle.com/introduction-to-okit-the-oci-designer-toolkit),
[deploy](https://www.ateam-oracle.com/introduction-to-okit-the-oci-designer-toolkit) and visualise ([introspect/query](https://www.ateam-oracle.com/the-oci-designer-toolkit-query-feature))
Expand Down
2 changes: 1 addition & 1 deletion containers/cloud/cloud_init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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"
- 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.3.1 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}"
Expand Down
2 changes: 1 addition & 1 deletion containers/cloud/okit-ws.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"metadata": {
"ssh_authorized_keys": "",
"user_data": "#cloud-config\nwrite_files:\n # Add aliases to bash (Note: At time of writing the append flag does not appear to be working)\n - path: /etc/.bashrc\n append: true\n content: |\n alias lh='ls -lash'\n alias lt='ls -last'\n alias env='/usr/bin/env | sort'\n\nruncmd:\n # Install Required Packages because the packages section may not complete before the runcmd\n - sudo bash -c \"yum install -y git python-oci-cli oci-utils\"\n # Install Required Python Modules\n - 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\"\n # Clone OKIT\n - sudo bash -c \"git clone -b master --depth 1 https://github.com/oracle/oci-designer-toolkit.git /okit\"\n - sudo bash -c \"mkdir /okit/{log,workspace}\"\n # Add additional environment information because append does not appear to work in write_file\n - sudo bash -c \"echo 'source /etc/.bashrc' >> /etc/bashrc\"\n - sudo bash -c \"echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc\"\n - sudo bash -c \"echo 'export OKIT_VM_COMPARTMENT=`oci-metadata -g \"compartmentID\" --value-only`' >> /etc/bashrc\"\n # Copy GUnicorn Service File\n - sudo bash -c 'sed \"s/{COMPARTMENT_OCID}/`oci-metadata -g compartmentID --value-only`/\" /okit/containers/services/gunicorn.service > /etc/systemd/system/gunicorn.service'\n # Enable Gunicorn Service\n - sudo systemctl enable gunicorn.service\n - sudo systemctl start gunicorn.service\n\nfinal_message: \"**** The system is finally up, after $UPTIME seconds ****\"\n"
"user_data": "#cloud-config\nwrite_files:\n # Add aliases to bash (Note: At time of writing the append flag does not appear to be working)\n - path: /etc/.bashrc\n append: true\n content: |\n alias lh='ls -lash'\n alias lt='ls -last'\n alias env='/usr/bin/env | sort'\n\nruncmd:\n # Install Required Packages because the packages section may not complete before the runcmd\n - sudo bash -c \"yum install -y git python-oci-cli oci-utils\"\n # Install Required Python Modules\n - 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.3.1 requests==2.24.0 xlsxwriter==1.3.6\"\n # Clone OKIT\n - sudo bash -c \"git clone -b master --depth 1 https://github.com/oracle/oci-designer-toolkit.git /okit\"\n - sudo bash -c \"mkdir /okit/{log,workspace}\"\n # Add additional environment information because append does not appear to work in write_file\n - sudo bash -c \"echo 'source /etc/.bashrc' >> /etc/bashrc\"\n - sudo bash -c \"echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc\"\n - sudo bash -c \"echo 'export OKIT_VM_COMPARTMENT=`oci-metadata -g \"compartmentID\" --value-only`' >> /etc/bashrc\"\n # Copy GUnicorn Service File\n - sudo bash -c 'sed \"s/{COMPARTMENT_OCID}/`oci-metadata -g compartmentID --value-only`/\" /okit/containers/services/gunicorn.service > /etc/systemd/system/gunicorn.service'\n # Enable Gunicorn Service\n - sudo systemctl enable gunicorn.service\n - sudo systemctl start gunicorn.service\n\nfinal_message: \"**** The system is finally up, after $UPTIME seconds ****\"\n"
},
"block_storage_volume_ids": [],
"object_storage_bucket_ids": [],
Expand Down
4 changes: 2 additions & 2 deletions containers/docker/8-slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ RUN microdnf install -y \
# python36-oci-sdk \
nginx \
# Upgrade pip
&& python3 -m pip install --upgrade pip==20.0.2 \
&& python3 -m pip install --upgrade pip \
# Install required python modules
&& pip3 install --no-cache-dir \
flask==1.1.1 \
gunicorn==20.0.4 \
oci==2.6.0 \
python-magic==0.4.18 \
pyyaml==5.2 \
pyyaml==5.3.1 \
# Create Workspace
&& mkdir -p /okit/{config,log,visualiser,okitweb,workspace,templates} \
&& mkdir -p /okit/okitweb/static/okit/templates \
Expand Down
6 changes: 3 additions & 3 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.13.0" \
"version"="0.14.0" \
"description"="OKIT Web Server Container." \
"copyright"="Copyright (c) 2020, Oracle and/or its affiliates."
SHELL ["/bin/bash", "-c"]
Expand Down Expand Up @@ -37,15 +37,15 @@ RUN yum install -y \
# rh-nginx114 \
&& rm -rf /var/cache/yum \
# Upgrade pip
&& python3 -m pip install --upgrade pip==20.0.2 \
&& python3 -m pip install --upgrade pip \
# 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 \
pyyaml==5.3.1 \
requests==2.24.0 \
xlsxwriter==1.3.6 \
# Create Workspace
Expand Down
2 changes: 1 addition & 1 deletion containers/vagrant/configure_software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pip3 install --no-cache-dir \
oci==2.22.0 \
pandas==1.1.2 \
python-magic==0.4.18 \
pyyaml==5.2 \
pyyaml==5.3.1 \
requests==2.24.0 \
xlsxwriter==1.3.6

22 changes: 20 additions & 2 deletions documentation/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,18 @@ If you do not have git installed locally the current release of OKIT can be retr

### Create Container

#### Copy Config & Key Files
Before building/rebuilding your chosen container you will need to copy the contents of [<USER HOME DIR>/.oci](#config-file)
to the __oci-designer-toolkit/containers/oci__ directory.

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

##### Prerequisites
- Install [Docker Desktop](https://www.docker.com/products/docker-desktop).
- Create local directory __~/okit/user/templates__ for storage of custom templates.
- [Copy Config & Key Files](#copy-config--key-files)

##### Docker Compose Build
```bash
cd oci-designer-toolkit/containers/docker
Expand All @@ -159,17 +165,24 @@ The docker image can be built and started using the scripts in the docker sub d
It should be noted that the current Docker script is designed for development purposes and mounts the source directories
at runtime.

##### Prerequisites
- Install [Docker Desktop](https://www.docker.com/products/docker-desktop).
- Create local directory __~/okit/user/templates__ for storage of custom templates.
- [Copy Config & Key Files](#copy-config--key-files)

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

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

##### Start Docker Container
```bash
cd oci-designer-toolkit
Expand All @@ -181,16 +194,21 @@ docker run -d --rm -p 443:443 -p 80:80 \
```

#### Vagrant

##### Prerequisites
1. Install [Oracle VM VirtualBox](https://www.virtualbox.org/wiki/Downloads)
2. Install [Vagrant](https://vagrantup.com/)
- Install [Oracle VM VirtualBox](https://www.virtualbox.org/wiki/Downloads)
- Install [Vagrant](https://vagrantup.com/)
- Create local directory __~/okit/user/templates__ for storage of custom templates.
- [Copy Config & Key Files](#copy-config--key-files)

##### Vagrant Build
```bash
cd oci-designer-toolkit/containers/vagrant/
vagrant up; vagrant reload; vagrant ssh
```
**NOTE**: This step takes about 30 minutes on my mac when you build the VM, a little longer the first time as the Vbox image
is downloaded from github. Once the VM is built the vagrant up should just take a few seconds.

##### Vagrant
```bash
cd oci-designer-toolkit/containers/vagrant
Expand Down
34 changes: 34 additions & 0 deletions okitweb/okitOci.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
__module__ = "okitOci"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

import json
import oci
import os
import shutil
import tempfile
import time
import urllib
from flask import Blueprint
from flask import request
from flask import jsonify

import json
from common.okitCommon import logJson
Expand Down Expand Up @@ -80,6 +83,37 @@
# Define Error Handlers
#

@bp.errorhandler(oci.exceptions.ServiceError)
def handle_oci_service_error(error):
status_code = 500
success = False
message = ''
code = ''
for x in error.args:
logger.info(x)
if 'opc-request-id' in x:
code = x['code']
message = x['message']
status_code = x['status']
break
logger.info(message)
response = {
'success': success,
'error': {
'type': error.__class__.__name__,
'code': code,
'message': message
}
}
logger.exception(error)
logJson(response)
return jsonify(response), status_code


#
# Define Endpoints
#

@bp.route('/resourcemanager', methods=(['GET', 'POST']))
def ociResourceManger():
if request.method == 'GET':
Expand Down
1 change: 1 addition & 0 deletions okitweb/okitWebDesigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

import configparser
import oci
import os
import shutil
import tempfile
Expand Down
15 changes: 15 additions & 0 deletions okitweb/static/okit/css/okit_designer.css
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@
rect.highlight {
stroke-width: 3;
stroke-dasharray: none;
stroke-opacity: 1;
}

rect.highlight-rect {
stroke-width: 2;
stroke-opacity: 1;
}

rect.highlight-vnic {
Expand All @@ -349,6 +355,15 @@ rect.highlight-vnic {

rect.highlight-association {
fill: #336600;
stroke-width: 2;
stroke-opacity: 1;
}

rect.highlight-properties {
fill: #336600;
stroke: red;
stroke-width: 2;
stroke-opacity: 1;
}

/*
Expand Down
Loading

0 comments on commit 64c4595

Please sign in to comment.