Skip to content

Commit

Permalink
Merge pull request #618 from epiphany-platform/develop
Browse files Browse the repository at this point in the history
Develop to Master for Github 0.4.1 release.
  • Loading branch information
seriva committed Oct 18, 2019
2 parents 0e35b04 + fe63038 commit 9833443
Show file tree
Hide file tree
Showing 70 changed files with 494 additions and 232 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG-0.4.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog 0.4

## [0.4.1] 2019-10-17

### Fixed


- [#612](https://github.com/epiphany-platform/epiphany/issues/612) - 'epicli delete' - cannot delete a partially built infrastructure
- [#613](https://github.com/epiphany-platform/epiphany/pull/613) - Hotfixes for Ubuntu offline installation in air-gap mode
- [#614](https://github.com/epiphany-platform/epiphany/pull/614) - Fixed RotatingFileHandler permission error (for Docker Toolbox on Windows)
- [#615](https://github.com/epiphany-platform/epiphany/issues/615) - Minor Azure bugs for 0.4.0 release
- [#620](https://github.com/epiphany-platform/epiphany/issues/620) - Incorrect Ansible metadata (prerequisite) for Kubernetes Node

## [0.4.0] 2019-10-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion core/src/epicli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.7-alpine

ENV DOCKER_CLI Yes
ENV EPICLI_VERSION 0.4.0
ENV EPICLI_VERSION 0.4.1

COPY /dist/ /epicli
WORKDIR /epicli
Expand Down
4 changes: 3 additions & 1 deletion core/src/epicli/cli/engine/BuildEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def apply(self):

self.process_infrastructure_docs()

save_manifest([*self.input_docs, *self.infrastructure_docs], self.cluster_model.specification.name)

if not (self.skip_infrastructure or self.is_provider_any(self.cluster_model)):
# Generate terraform templates
with TerraformTemplateGenerator(self.cluster_model, self.infrastructure_docs) as template_generator:
Expand Down Expand Up @@ -124,7 +126,7 @@ def dry_run(self):

self.process_configuration_docs()

return [*self.input_docs, *self.configuration_docs]
return [*self.configuration_docs, *self.infrastructure_docs]

@staticmethod
def is_provider_any(cluster_model):
Expand Down
9 changes: 3 additions & 6 deletions core/src/epicli/cli/engine/InitEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@ def get_full_config(self, config_docs):
cluster_config_path = save_manifest(config_docs, self.name, self.name + '.yml')
args = type('obj', (object,), {'file': cluster_config_path})()
with BuildEngine(args) as build:
config_docs = build.dry_run()

infra_docs = load_all_documents_from_folder(self.provider, 'defaults/infrastructure')
merged_docs = [*config_docs, *infra_docs]
docs = build.dry_run()

# set the provider for all docs
for doc in merged_docs:
for doc in docs:
if 'provider' not in doc.keys():
doc['provider'] = self.provider

return merged_docs
return docs



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def run(self):
if (len(component_value.subnets) > 1):
self.logger.warning(f'On Azure only one subnet per component is supported for now. Taking first and ignoring others.')

# Add message for ignoring availabiltity zones if present.
if 'availability_zone' in component_value.subnets[0]:
self.logger.warning(f'On Azure availability_zones are not supported jet. Ignoring definition.')

subnet_definition = component_value.subnets[0]
subnet = select_first(infrastructure, lambda item: item.kind == 'infrastructure/subnet' and
item.specification.address_prefix == subnet_definition['address_pool'])
Expand Down
10 changes: 5 additions & 5 deletions core/src/epicli/cli/helpers/Log.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ def __init__(self):
log_path = os.path.join(get_output_path(), config.log_file)
logging.basicConfig(level=logging.INFO, format=config.log_format, datefmt=config.log_date_format)
formatter = jsonlogger.JsonFormatter(config.log_format, datefmt=config.log_date_format)
self.json_file_handler = logging.FileHandler(filename=log_path)
self.json_file_handler.setFormatter(formatter)
self.json_stream_handler = logging.StreamHandler()
self.json_stream_handler.setFormatter(formatter)
should_roll_over = os.path.isfile(log_path)
handler = logging.handlers.RotatingFileHandler(log_path, mode='w', backupCount=config.log_count)
handler = logging.handlers.RotatingFileHandler(log_path, backupCount=config.log_count)
if should_roll_over:
handler.doRollover()
self.json_file_handler = handler
self.json_file_handler.setFormatter(formatter)
self.json_stream_handler = logging.StreamHandler()
self.json_stream_handler.setFormatter(formatter)

instance = None

Expand Down
7 changes: 4 additions & 3 deletions core/src/epicli/cli/helpers/naming_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ def storage_account_name(prefix, cluster_name, storage_use):
sto = storage_use.lower()

clu = ''
cn = cluster_name.replace('-', '')
length = 24 - (len(pre)+len(sto))
if len(cluster_name) > length:
clu = cluster_name[:length].lower()
if len(cn) > length:
clu = cn[:length].lower()
else:
clu = cluster_name.lower()
clu = cn.lower()

return f'{pre}{clu}{sto}'

2 changes: 1 addition & 1 deletion core/src/epicli/cli/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '0.4.0'
VERSION = '0.4.1'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: epiphany-cluster
version: 0.4.0
version: 0.4.1
title: "Epiphany cluster Config"
provider: any
name: "default"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: epiphany-cluster
version: 0.4.0
version: 0.4.1
title: "Epiphany cluster Config"
provider: aws
name: "default"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/default-security-group
version: 0.4.0
version: 0.4.1
title: "Default Security Group Config"
provider: aws
name: default-security-group
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/efs-storage
version: 0.4.0
version: 0.4.1
title: "Elastic File System Config"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/internet-gateway
version: 0.4.0
version: 0.4.1
title: "Internet Gateway Config"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/launch-configuration
version: 0.4.0
version: 0.4.1
title: "Launch configuration"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/public-key
version: 0.4.0
version: 0.4.1
title: "Public Key"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/resource-group
version: 0.4.0
version: 0.4.1
title: "Resource Group"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/route-table-association
version: 0.4.0
version: 0.4.1
title: Route Table Association Config"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/route-table
version: 0.4.0
version: 0.4.1
title: "Route Table Config"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/security-group-rule
version: 0.4.0
version: 0.4.1
title: "Default Group Rule"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/security-group
version: 0.4.0
version: 0.4.1
title: "Security Group Config"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/subnet
version: 0.4.0
version: 0.4.1
title: "Subnet Config"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: default
Expand All @@ -13,7 +13,7 @@ specification:
authorized_to_efs: false
mount_efs: false
tags:
- version: 0.4.0
- version: 0.4.1
size: t2.micro
os_full_name: "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20190212.1"
os_type: linux
Expand Down Expand Up @@ -84,13 +84,13 @@ specification:

---
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: default-size-t3
specification:
tags:
- version: 0.4.0
- version: 0.4.1
size: t3.micro
os_type: linux
security:
Expand All @@ -117,13 +117,13 @@ specification:
destination_address_prefix: "0.0.0.0/0"
---
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: rabbitmq-machine
specification:
tags:
- version: 0.4.0
- version: 0.4.1
size: t3.micro
os_type: linux
security:
Expand Down Expand Up @@ -190,13 +190,13 @@ specification:
destination_address_prefix: "0.0.0.0/0"
---
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: load-balancer-machine
specification:
tags:
- version: 0.4.0
- version: 0.4.1
size: t3.micro
os_type: linux
security:
Expand Down Expand Up @@ -243,7 +243,7 @@ specification:
destination_address_prefix: "0.0.0.0/0"
---
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: kubernetes-master-machine
Expand Down Expand Up @@ -343,7 +343,7 @@ specification:
destination_address_prefix: "0.0.0.0/0"
---
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: kubernetes-node-machine
Expand Down Expand Up @@ -421,7 +421,7 @@ specification:
destination_address_prefix: "0.0.0.0/0"
---
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: kafka-machine
Expand Down Expand Up @@ -547,7 +547,7 @@ specification:
destination_address_prefix: "0.0.0.0/0"
---
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: monitoring-machine
Expand Down Expand Up @@ -607,7 +607,7 @@ specification:
destination_address_prefix: "0.0.0.0/0"
---
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: postgresql-machine
Expand Down Expand Up @@ -681,7 +681,7 @@ specification:
destination_address_prefix: "0.0.0.0/0"
---
kind: infrastructure/virtual-machine
version: 0.4.0
version: 0.4.1
title: "Virtual Machine Infra"
provider: aws
name: logging-machine
Expand Down
2 changes: 1 addition & 1 deletion core/src/epicli/data/aws/defaults/infrastructure/vpc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/vpc
version: 0.4.0
version: 0.4.1
title: "VPC Config"
provider: aws
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: epiphany-cluster
version: 0.4.0
version: 0.4.1
title: "Epiphany cluster Config"
provider: azure
name: "default"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/network-interface
version: 0.4.0
version: 0.4.1
title: "Network Interface Config"
provider: azure
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/network-security-group
version: 0.4.0
version: 0.4.1
title: "Security Group Config"
provider: azure
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/public-ip
version: 0.4.0
version: 0.4.1
title: "Public IP Config"
provider: azure
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/resource-group
version: 0.4.0
version: 0.4.1
title: "Resource Group"
provider: azure
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/storage-share
version: 0.4.0
version: 0.4.1
title: "Azure shared storage"
provider: azure
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/subnet-network-security-group-association
version: 0.4.0
version: 0.4.1
title: "Subnet Network Security Group Association"
provider: azure
name: default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: infrastructure/subnet
version: 0.4.0
version: 0.4.1
title: "Subnet Config"
provider: azure
name: default
Expand Down
Loading

0 comments on commit 9833443

Please sign in to comment.