Skip to content
This repository has been archived by the owner on Jan 13, 2020. It is now read-only.
/ accelpy Public archive

Commit

Permalink
1.0.0-beta.25
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin committed Sep 20, 2019
1 parent cbbfca6 commit 14d02e5
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 21 deletions.
2 changes: 1 addition & 1 deletion accelpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__version__ = '1.0.0-beta.24'
__version__ = '1.0.0-beta.25'
__copyright__ = "Copyright 2019 Accelize"
__licence__ = "Apache 2.0"

Expand Down
7 changes: 1 addition & 6 deletions accelpy/_ansible/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ def environment():
Returns:
dict: Ansible environment.
"""
# TODO: Test and enable once Ansible 2.8 is supported
# import ansible_mitogen.plugins.strategy as strategy

no_color_mode = no_color()
debug_mode = debug()
return {
Expand All @@ -165,9 +162,7 @@ def environment():
# Speed up Ansible
'ANSIBLE_PIPELINING': True,
'ANSIBLE_SSH_ARGS':
'"-o ControlMaster=auto -o ControlPersist=60s"',
# 'ANSIBLE_STRATEGY': 'mitogen_linear',
# 'ANSIBLE_STRATEGY_PLUGINS': strategy.__path__[0],
'"-o ControlMaster=auto -o ControlPersist=60s"'
}

def _ansible(self, *args, utility=None, check=True, pipe_stdout=False,
Expand Down
9 changes: 6 additions & 3 deletions accelpy/_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,12 @@ def _check_value(key, key_format, value, section_name):

# Check single value type
elif value is not None and not isinstance(value, value_type):
raise ConfigurationException(
f'The "{key}" key in "{section_name}" section must be a '
f'"{value_type.__name__}".')
if value_type is str:
value = str(value)
else:
raise ConfigurationException(
f'The "{key}" key in "{section_name}" section must be a '
f'"{value_type.__name__}".')

valid_values = key_format.get('values')
valid_regex = key_format.get('regex')
Expand Down
4 changes: 2 additions & 2 deletions docs/application_definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Example:
type: vm_image
name: ami-01010101010
aws,eu-west-2:
aws,eu-west-2,f1:
type: vm_image
name: ami-10101010101
Expand All @@ -254,7 +254,7 @@ Example:
image: agfi-01010101010
driver: aws_f1
aws,eu-west-2:
aws,eu-west-2,f1:
image: agfi-10101010101
driver: aws_f1
Expand Down
23 changes: 16 additions & 7 deletions docs/application_kubernetes_node.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Kubernetes architecture to run FPGA powered pods.

This also allow provision the application as a single Kubernetes master/node
to easily test the application on a standalone disposable Kubernetes
infrastructure.
infrastructure, and then to build a node image that can be used to deploy the
FPGA application on any existing Kubernetes infrastructure.

Prerequisites
-------------
Expand Down Expand Up @@ -49,8 +50,8 @@ Variables
This application support following variables:

* `master_node`: If set to `true` (Default value), install the application as a
single master/node. If set to `false`, install the application as a single
node that must be integrated with an existing Kubernetes infrastructure.
single master/node. If set to `false`, install the application as a node that
must be integrated with an existing Kubernetes infrastructure.
* `kubernetes_join_command`: Only if `master_node` is `false`. A command
to run on the node to joint the Kubernetes master. This command may be
generated by running `kubeadm token create --print-join-command` on the
Expand Down Expand Up @@ -103,17 +104,17 @@ in `privileged` mode to have FPGA access. This means that the container run as

It is not recommanded to use privileged containers in production.

Single node mode
----------------
Node mode
---------

In the master/node mode, the provided Kubernetes YAML configuration are applied
and the application should be ready to use.

In the single node mode, the node is provisioned with FPGA and Kubernetes node
In the node mode, the node is provisioned with FPGA and Kubernetes node
requirements but nothing is applied. You needs to join your node to your
infrastructure and apply your configuration on your master on the node.

The single node mod is mainly intended to be used with `accelpy build` to create
The node mode is mainly intended to be used with `accelpy build` to create
a virtual machine image that can be used as base to create FPGA nodes in an
existing Kubernetes infrastructure.

Expand Down Expand Up @@ -142,3 +143,11 @@ Examples
Here are some examples of deployment using this application type:

* :doc:`example_kubeless_function`


Known issues
------------

In the single master/node mode, virtual machines image generated from
`accelpy build` will not work properly once deployed due to the change of the
IP address.
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
'requests>=2.20.0',
'ansible>=2.8,<2.9',
'argcomplete>=1.10',
# 'jinja2', Let dependency version be managed by "ansible"
# 'mitogen>=0.2.7',
'awscli>=1.16' # To remove once Terraform support spot instance tagging
],
setup_requires=['setuptools'],
Expand Down
18 changes: 18 additions & 0 deletions tests/test_core_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,24 @@ def test_lint(tmpdir):
with pytest.raises(ConfigurationException):
Application(yml_file)

# Test: Bad value type for str type
yml_file.write("""
application:
product_id: my_product_id
version: 1.0.0
package:
- type: container_image
name: my_container_image
fpga:
image: image
# Driver version should be a str
driver_version: 1.0
""")
with pytest.raises(ConfigurationException):
Application(yml_file)

# Test: Bad value type in list
yml_file.write("""
application:
Expand Down

0 comments on commit 14d02e5

Please sign in to comment.