diff --git a/accelpy/__init__.py b/accelpy/__init__.py index 3bdd1ea..7ae35c9 100644 --- a/accelpy/__init__.py +++ b/accelpy/__init__.py @@ -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" diff --git a/accelpy/_ansible/__init__.py b/accelpy/_ansible/__init__.py index 64a3704..6a8d646 100644 --- a/accelpy/_ansible/__init__.py +++ b/accelpy/_ansible/__init__.py @@ -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 { @@ -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, diff --git a/accelpy/_application.py b/accelpy/_application.py index 2966a12..d298095 100644 --- a/accelpy/_application.py +++ b/accelpy/_application.py @@ -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') diff --git a/docs/application_definition.rst b/docs/application_definition.rst index 3c26d47..9f252a1 100644 --- a/docs/application_definition.rst +++ b/docs/application_definition.rst @@ -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 @@ -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 diff --git a/docs/application_kubernetes_node.rst b/docs/application_kubernetes_node.rst index e245270..fb000a8 100644 --- a/docs/application_kubernetes_node.rst +++ b/docs/application_kubernetes_node.rst @@ -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 ------------- @@ -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 @@ -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. @@ -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. diff --git a/setup.py b/setup.py index 9533f4b..17a8dec 100755 --- a/setup.py +++ b/setup.py @@ -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'], diff --git a/tests/test_core_application.py b/tests/test_core_application.py index e9b5c78..aa43212 100644 --- a/tests/test_core_application.py +++ b/tests/test_core_application.py @@ -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: