Skip to content

Commit

Permalink
Merge pull request #60 from cloudify-cosmo/replace-wagon-builder-to-p…
Browse files Browse the repository at this point in the history
…y2py3-builder

Replace wagon builder to py2py3 builder
  • Loading branch information
AdarShaked authored Jun 28, 2020
2 parents cd7034c + a377d30 commit c866980
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 22 deletions.
128 changes: 111 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ executors:
machine:
image: ubuntu-1604:201903-01

cloudify-machine-510:
machine:
image: ubuntu-1604:201903-01

commands:
run_unittest:
Expand Down Expand Up @@ -74,16 +77,16 @@ commands:
exit 1
fi
generate_py27_wagon:
generate_py27py36_wagon:
steps:
- run:
name: Create Workspace Build directory.
command: mkdir -p workspace/build
- run:
name: Build py27 Wagon
name: Build py27py36 Wagon
command: |
git clone https://github.com/cloudify-cosmo/cloudify-wagon-build-containers.git
docker build -t cloudify-centos-7-wagon-builder cloudify-wagon-build-containers/centos_7
docker build -t cloudify-centos-7-wagon-builder cloudify-wagon-build-containers/centos_7_py2py3
docker run -v ~/project/:/packaging cloudify-centos-7-wagon-builder
- run:
name: copy wagon to workspace
Expand All @@ -93,17 +96,17 @@ commands:
paths:
- build/*

generate_py3_wagon:
generate_rhel_py27py36_wagon:
steps:
- run:
name: Create Workspace Build directory.
command: mkdir -p workspace/build
- run:
name: Build py3 Wagon
name: Build RHEL py27py36 Wagon
command: |
git clone https://github.com/cloudify-cosmo/cloudify-wagon-build-containers.git
docker build -t cloudify-centos-7-py3-wagon-builder cloudify-wagon-build-containers/centos_7_py3
docker run -v ~/project/:/packaging cloudify-centos-7-py3-wagon-builder
docker build -t cloudify-redhat-7-wagon-builder cloudify-wagon-build-containers/redhat_7_py2py3 --build-arg USERNAME="$USERNAME" --build-arg PASSWORD="$PASSWORD"
docker run -v ~/project/:/packaging cloudify-redhat-7-wagon-builder
- run:
name: copy wagon to workspace
command: cp *.wgn workspace/build/
Expand All @@ -112,7 +115,7 @@ commands:
paths:
- build/*

run_integration_tests:
run_integration_tests_505:
steps:
- run:
name: "Pull Submodules"
Expand All @@ -125,7 +128,8 @@ commands:
command: pip install -U pip
- run:
name: install cloudify
command: pip install -U cloudify==5.0.0 pytest==4.6.3 pyyaml==3.10
command: |
pip install -r test-requirements.txt
- run:
name: download manager docker image
command: wget http://repository.cloudifysource.org/cloudify/5.0.5/ga-release/cloudify-docker-manager-5.0.5.tar
Expand All @@ -146,6 +150,41 @@ commands:
command: pip install https://github.com/cloudify-incubator/cloudify-ecosystem-test/archive/latest.zip
- run: pytest -s .circleci/test_examples.py

run_integration_tests_510:
steps:
- run:
name: "Pull Submodules"
command: |
git submodule update --init --recursive
- attach_workspace:
at: workspace
- run:
name: update pip
command: pip install -U pip
- run:
name: install cloudify
command: |
pip install -r test-requirements.txt
- run:
name: download manager docker image
command: wget http://repository.cloudifysource.org/cloudify/5.1.0/.dev1-release/cloudify-docker-manager-5.1.0.dev1.tar
- run:
name: load docker image
command: docker load -i cloudify-docker-manager-5.1.0.dev1.tar
- run:
name: retain space by dumping the tar
command: rm cloudify-docker-manager-5.1.0.dev1.tar
- run:
name: show images
command: docker images
- run:
name: start docker container
command: docker run --name cfy_manager -d --restart unless-stopped -v /sys/fs/cgroup:/sys/fs/cgroup:ro --tmpfs /run --tmpfs /run/lock --security-opt seccomp:unconfined --cap-add SYS_ADMIN --network host cloudifyplatform/premium-cloudify-manager-aio
- run:
name: install local project
command: pip install https://github.com/cloudify-incubator/cloudify-ecosystem-test/archive/latest.zip
- run: pytest -s .circleci/test_examples.py

release_plugin:
steps:
- run:
Expand Down Expand Up @@ -202,18 +241,31 @@ jobs:
executor: wagon_generator
steps:
- checkout
- generate_py27_wagon
# - generate_py3_wagon # TODO: When we have Python3 Manager Integration Test.
- generate_py27py36_wagon

rhel_wagon:
executor: wagon_generator
steps:
- checkout
- generate_rhel_py27py36_wagon

integration_tests:
integration_tests_505:
executor: cloudify-machine
environment:
CLOUDIFY_SSL_TRUST_ALL: true
IAAS: gcp
steps:
- checkout
- run_integration_tests
- run_integration_tests_505

integration_tests_510:
executor: cloudify-machine-510
environment:
CLOUDIFY_SSL_TRUST_ALL: true
IAAS: gcp
steps:
- checkout
- run_integration_tests_510
release:
executor: py27
steps:
Expand All @@ -223,17 +275,29 @@ jobs:
workflows:
version: 2
tests:
jobs: &all_jobs
jobs:
- py3_compat
- unittests_py27
- unittests_py36
- wagon:
filters:
branches:
only: /([0-9\.]*\-build|master|dev)/
- integration_tests:
- rhel_wagon:
filters:
branches:
only: /([0-9\.]*\-build|master|dev)/
- integration_tests_505:
requires:
- wagon
- rhel_wagon
filters:
branches:
only: /([0-9\.]*\-build|master|dev)/
- integration_tests_510:
requires:
- wagon
- rhel_wagon
filters:
branches:
only: /([0-9\.]*\-build|master|dev)/
Expand All @@ -242,8 +306,12 @@ workflows:
branches:
only: /master/
requires:
- unittests_py27
- unittests_py36
- wagon
- integration_tests
- rhel_wagon
- integration_tests_505
- integration_tests_510
nightly:
triggers:
- schedule:
Expand All @@ -252,4 +320,30 @@ workflows:
branches:
only:
- master
jobs: *all_jobs
jobs:
- py3_compat
- unittests_py27
- unittests_py36
- wagon:
filters:
branches:
only: /([0-9\.]*\-build|master|dev)/
- rhel_wagon:
filters:
branches:
only: /([0-9\.]*\-build|master|dev)/
- integration_tests_505:
requires:
- wagon
- rhel_wagon
filters:
branches:
only: /([0-9\.]*\-build|master|dev)/
- integration_tests_510:
requires:
- wagon
- rhel_wagon
filters:
branches:
only: /([0-9\.]*\-build|master|dev)/

18 changes: 17 additions & 1 deletion .circleci/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,27 @@
cleanup_on_failure, prepare_test
)

'''Temporary until all the plugins in the bundle will
released with py2py3 wagons'''
UT_VERSION = '1.23.5'
UT_WAGON = 'https://github.com/cloudify-incubator/cloudify-utilities-plugin/' \
'releases/download/{v}/cloudify_utilities_plugin-{v}-centos' \
'-Core-py27.py36-none-linux_x86_64.wgn'.format(v=UT_VERSION)
UT_PLUGIN = 'https://github.com/cloudify-incubator/cloudify-utilities-' \
'plugin/releases/download/{v}/plugin.yaml'.format(v=UT_VERSION)
GCP_VERSION = '1.6.6'
GCP_WAGON = 'https://github.com/cloudify-cosmo/cloudify-gcp-plugin/' \
'releases/download/{v}/cloudify_gcp_plugin-{v}-centos-' \
'Core-py27.py36-none-linux_x86_64.wgn'.format(v=GCP_VERSION)
GCP_PLUGIN = 'https://github.com/cloudify-cosmo/cloudify-gcp-plugin/releases/' \
'download/{v}/plugin.yaml'.format(v=GCP_VERSION)
PLUGINS_TO_UPLOAD = [(UT_WAGON, UT_PLUGIN), (GCP_WAGON, GCP_PLUGIN)]
SECRETS_TO_CREATE = {
'gcp_credentials': True
}

prepare_test(secrets=SECRETS_TO_CREATE)
prepare_test(plugins=PLUGINS_TO_UPLOAD, secrets=SECRETS_TO_CREATE,
execute_bundle_upload=False)

blueprint_list = ['examples/blueprint-examples/hello-world-example/gcp.yaml']

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@

2.9.1:
- Fix Bug introduced by plugin yaml changes in 2.9.1

2.9.2:
- Update wagon builder to py2py3 wagon and add rhel wagon builder.
- Added 5.1.0 manager integration tests.
4 changes: 2 additions & 2 deletions plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ plugins:

ansible:
executor: central_deployment_agent
source: https://github.com/cloudify-cosmo/cloudify-ansible-plugin/archive/2.9.1.zip
source: https://github.com/cloudify-cosmo/cloudify-ansible-plugin/archive/2.9.2.zip
package_name: cloudify-ansible-plugin
package_version: '2.9.1'
package_version: '2.9.2'

dsl_definitions:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name='cloudify-ansible-plugin',
version='2.9.1',
version='2.9.2',
author='Cloudify Platform LTD',
author_email='[email protected]',
description='Manage Ansible nodes by Cloudify.',
Expand Down
7 changes: 6 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
https://github.com/cloudify-cosmo/cloudify-common/archive/master.zip#egg=cloudify[dispatcher]
nose
mock

# For integration tests
git+https://github.com/cloudify-cosmo/cloudify-common@master#egg=cloudify-common[dispatcher]==master
git+https://github.com/cloudify-cosmo/cloudify-cli@master#egg=cloudify-cli==master
pytest==4.6.3
pyyaml==3.12

0 comments on commit c866980

Please sign in to comment.