Skip to content

Commit

Permalink
Merge pull request #68 from oracle/sprint-7
Browse files Browse the repository at this point in the history
Sprint 7
  • Loading branch information
toxophilist authored Aug 5, 2020
2 parents 9ef30e0 + 5ca18b2 commit 5956171
Show file tree
Hide file tree
Showing 147 changed files with 9,940 additions and 8,379 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ containers/.oci

containers/oci/*
!containers/oci/example_config

!okitweb/static/model
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Release Notes


## Version 0.9.0
**Release Date**: 5th August 2020
### Features
1. Split Designer View functionality from OKIT Model (OKIT-89).
2. Update Json associated with the Fragments to conform to new structure and remove non Reference Architecture templates because these are fragments. (OKIT-101).
3. Check oci config file to identify if the key file exists in the container and if not display error icon with associated click / alert message (OKIT-48 / OKIT-96).
4. Add preferences option (Hide Attached Artefacts) to indicate if Route Tables / Security List should be displayed as part of the Virtual Cloud Networks as well as an attachment.
5. Hide Service CIDR when Service Gateway in Route Rule is selected.

### Bug Fixes
1. Resolve issue with the "description" for Network Security Groups which was being incorrectly rendered in the generated Terraform.
2. Attached Route Tables / Security List property edits were lost. (OKIT-70).
3. Resolve issue with the "compartment_id" for Compartment which was being incorrectly rendered in the generated Terraform.
4. During query AD specific Subnets return Availability Domain as string not integer value, this is now converted (OKIT-105).
5. Deleting Defined Tags did not remove them from the model (OKIT-106).
6. Instance OS & Version information not retrieved during Query (OKIT-108).
7. DRG Ansible template contains '=' not ':' (GitHub Issue #61).
8. Quotes added to security Ingress / Egress rules (GitHub Issue #65).


## Version 0.8.0
**Release Date**: 15th July 2020
### Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OCI Designer Toolkit [0.8.0](CHANGELOG.md#version-0.8.0)
# OCI Designer Toolkit [0.9.0](CHANGELOG.md#version-0.9.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
13 changes: 5 additions & 8 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.8.0" \
"version"="0.9.0" \
"description"="OKIT Web Server Container." \
"copyright"="Copyright (c) 2020, Oracle and/or its affiliates."
SHELL ["/bin/bash", "-c"]
Expand All @@ -23,34 +23,31 @@ EXPOSE 443
# Install new yum repos
RUN yum install -y \
oracle-softwarecollection-release-el7 \
oraclelinux-developer-release-el7 \
# Update base image
&& yum update -y \
# Install additional packages
&& yum install -y \
python36 \
python3-pip \
# python36-pyyaml \
# python36-oci-sdk \
# rh-nginx114 \
&& 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 \
click==7.0 \
flask==1.1.1 \
gunicorn==20.0.4 \
itsdangerous==1.1.0 \
jinja2==2.10.3 \
markupsafe==1.1.1 \
oci==2.6.0 \
pyyaml==5.2 \
werkzeug==0.16.0 \
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=4", "--limit-request-line", "0", "--timeout", "120", "--bind=0.0.0.0:80", "okitweb.wsgi:app"]
189 changes: 81 additions & 108 deletions documentation/Development.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions documentation/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ 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.8.0 the Release tag will be
**v0.8.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.9.0 the Release tag will be
**v0.9.0**. The command shows how this can be cloned to the local machine.

```bash
git clone -b v0.8.0 --depth 1 [email protected]:oracle/oci-designer-toolkit.git
git clone -b v0.9.0 --depth 1 [email protected]:oracle/oci-designer-toolkit.git
```

or

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

### Download
If you do not have git installed locally the current release of OKIT can be retrieved by downloading it as a zip file from
https://github.com/oracle/oci-designer-toolkit/archive/v0.8.0.zip
https://github.com/oracle/oci-designer-toolkit/archive/v0.9.0.zip


## OCI Config File
Expand Down
4 changes: 2 additions & 2 deletions okitweb/okitOci.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = ["Andrew Hopkinson (Oracle Cloud Solutions A-Team)"]
__version__ = "1.0.0"
__module__ = "okitPriceEstimator"
__module__ = "okitOci"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

import os
Expand Down Expand Up @@ -179,7 +179,7 @@ def ociQuery():
return '404'


@bp.route('/artifacts/<string:artifact>', methods=(['GET']))
@bp.route('/artefacts/<string:artifact>', methods=(['GET']))
def ociArtifacts(artifact):
logger.info('Artifact : {0:s}'.format(str(artifact)))
query_string = request.query_string
Expand Down
33 changes: 29 additions & 4 deletions okitweb/okitWebDesigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ def getConfigFileValue(section, key, config_file='~/.oci/config'):
config.read(abs_config_file)
return config[section][key]

def validateConfigFile(config_file='~/.oci/config'):
logger.debug('Config File {0!s:s}'.format(config_file))
abs_config_file = os.path.expanduser(config_file)
logger.debug('Config File {0!s:s}'.format(abs_config_file))
config = configparser.ConfigParser()
config.read(abs_config_file)
results = []
if len(config.sections()) == 0:
results.append('OCI Connect Config file is either missing or empty.')
else:
for section in config:
key_file = config[section]['key_file']
if not os.path.exists(os.path.expanduser(key_file)):
results.append('[{0!s:s}] Key File {1!s:s} does not exist.'.format(section, key_file))
logger.info(results)
return results

#
# Define Error Handlers
#
Expand All @@ -96,10 +113,10 @@ def handle_exception(error):

@bp.route('/designer', methods=(['GET']))
def designer():
# Read Artifact Specific JavaScript Files
oci_assets_js = sorted(os.listdir(os.path.join(bp.static_folder, 'js', 'oci_artefacts')))
# Read Artifact Model Specific JavaScript Files
artefact_model_js_files = sorted(os.listdir(os.path.join(bp.static_folder, 'model', 'js', 'artefacts')))
# Read Artifact View Specific JavaScript Files
artefact_view_js_files = sorted(os.listdir(os.path.join(bp.static_folder, 'view', 'designer', 'js', 'artefact')))
artefact_view_js_files = sorted(os.listdir(os.path.join(bp.static_folder, 'view', 'designer', 'js', 'artefacts')))

# Get Palette Icon Groups / Icons
svg_files = []
Expand Down Expand Up @@ -176,7 +193,7 @@ def designer():

#Render The Template
return render_template('okit/okit_designer.html',
oci_assets_js=oci_assets_js,
artefact_model_js_files=artefact_model_js_files,
artefact_view_js_files=artefact_view_js_files,
palette_icon_groups=palette_icon_groups,
fragment_icons=fragment_icons,
Expand Down Expand Up @@ -278,6 +295,14 @@ def configRegion(section):
else:
return 'Unknown Method', 500

@bp.route('config/validate', methods=(['GET']))
def configValidate():
if request.method == 'GET':
response = {"results": validateConfigFile()}
return response
else:
return 'Unknown Method', 500


@bp.route('validate', methods=(['POST']))
def validateJson():
Expand Down
15 changes: 15 additions & 0 deletions okitweb/static/okit/css/okit_console.css
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,21 @@ textarea {
align-items: center;
}

.okit-console-header-right {
display: block;
width: 80px;
text-align: right;
align-items: end;
}

.okit-console-header-right > a {
}

.config-icon {
width: 32px;
height: 32px;
}

.okit-console-main {
}

Expand Down
4 changes: 4 additions & 0 deletions okitweb/static/okit/css/okit_designer.css
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,7 @@ rect.highlight {
stroke-width: 3;
stroke-dasharray: none;
}

rect.highlight-vnic {
fill: #00cc00;
}
Loading

0 comments on commit 5956171

Please sign in to comment.