Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

ARIA-321 Provide Clearwater IMS example #191

Merged
merged 1 commit into from Sep 11, 2017
Merged

Conversation

tliron
Copy link
Contributor

@tliron tliron commented Aug 15, 2017

Related fixes included in this commit:

  • Allows capabilities, interfaces, and properties to override parent
    definition types only if the new type is a descendant of the overridden
    type
  • Fix bugs in model instrumentation (to allow ctx access to capability
    properties and complex values)
  • Fix to get_property intrinsic function
  • Fix the "required" field for parameters (it wasn't working)
  • Don't let scalar values be negative
  • Doc fixes related to ARIA-277

@asfgit
Copy link

asfgit commented Aug 15, 2017

Can one of the admins verify this patch?

@asfgit asfgit force-pushed the ARIA-321-clearwater branch 2 times, most recently from 5f1001d to 7679bc1 Compare August 15, 2017 22:46
template_name: clearwater-live-test-existing
template_author: ARIA
template_version: '1.0'
aria_version: '0.1.2'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the version should probably be 0.2.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

inputs:
hosts.ssh.user:
type: string
hosts.ssh.password:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is one "hosts.X.Y" and the other "existing_host.Z.W"? It makes it seem like the user/password and the public-address are for two different hosts, doesn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking forward here to the future template that will have multiple hosts. For consistency, I thought to call "hosts." so it would apply to all hosts. This is a simpler example with only one host.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

template_name: clearwater-single-existing
template_author: ARIA
template_version: '1.0'
aria_version: '0.1.2'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.2.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

description: >-
Existing SSH password.
type: string
existing_host.public_address:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment about hosts vs existing_host..?

# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have these empty files?
Why not simply omit such operation implementations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaving that as TODOs -- we do need a way to uininstall, too, no?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - it wasn't clear that this was a TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 added TODO

@@ -0,0 +1,15 @@
#!/bin/bash
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does dime's create operation install ralf? I'm not sure i understand the modeling. Is Ralf "contained in" Dime conceptually?
(even if this is the case, why have this file at all?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of software installation, installing Dime will install Ralf+Homestead. However, those components run entirely differently in terms of configuration, logging, networking, etc. I imagine that in the multi-node Clearwater there will be things in this script to configure networking (open ports) for Ralf specifically. So, again, this is left here as a TODO.

@@ -159,10 +159,6 @@ def get_data_type(context, presentation, field_name, allow_none=False):
else:
return str

# Make sure not derived from self
if type_name == presentation._name:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this about?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code was broken and threw an exception when reaching those lines. I found the bug by accident while working on this so just decided to do a spot fix.


return None

def satisfy_requirements(self):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure i understand this addition. who's calling this, and why is this a part of this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get_node_by_type and get_policy_by_type are utility functions for use by the ctx proxy. You can see them being used in clearwater/scripts/hosts/configure.sh. I see them as being very useful for users.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, those indeed seem useful - But I was actually referring to the satisfy_requirements and other methods, which I now see are the result of a merge issue - Note that they have been moved to topology.py, and should no longer be in service_instance.py.

return True
return False

def _is_node_a_target(self, source_node, target_node):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty confused by this.

  1. Who's using this?
  2. Why not check the node's incoming_relationships?
  3. Why is the private helper function recursive? The main public function already goes over all nodes and checks each one for a source node.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a leftover utility function from a previous experiment of mine (for solving an SMTP config challenge). It's not needed anymore, so I will just remove it.

@asfgit asfgit force-pushed the ARIA-321-clearwater branch 26 times, most recently from 5d9b24a to b5d8ab4 Compare September 7, 2017 18:59
@asfgit asfgit force-pushed the ARIA-321-clearwater branch 9 times, most recently from 40f2c8a to a03cf98 Compare September 7, 2017 20:48
- tox --version
- PYTEST_PROCESSES=1 tox -e $TOX_ENV
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not keep this instead of having it on each env line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While working on this file it seemed odd to me that this one env variable is not in the .travis.yml "env" section. It makes sense to group it here, too, because in the future we might find that some tox envs run fine with multiprocess. (The Travis VMs/containers all have 2 cores, actually. I still don't know why are our tests fail when we switch to 2 processes.)

- pip install --upgrade pip
- pip install --upgrade setuptools
- pip install tox

script:
- pip --version
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this? it can be useful for debugging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While working on fixing the tests, I actually added a whole bunch of stuff here to assist debugging. And then it occurred to me, why test pip version specifically? There is so much other stuff here that might be useful. (Also, we explicitly upgrade pip to the latest version when the test runs.) I think it's more confusing to have this here. If someone needs to debug something specific with the test mechanism on Travis, they can add whatever they want here (like I did) that is relevant.


before_install:
# Create SSH keys for SSH tests
- ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see the benefit of replacing password with keypair usage, and so IMO it's better to avoid this extra work + hardcoding file systme path in the actual SSH test - though obviously the test is aimed specifically at Travis env and so it doesn't matter that much I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in Slack, I added the use of keys during trying to fix the SSH tests, but when I managed to get them passing finally I decided to keep this change because I feel it tests more things: specifically the parts of Python cryptography support. Since using keys instead of passwords is by far more common in cloud platforms (it should be required, really!) I thought it would more sense to keep this test as is.

Also not that our SSH tests are specifically designed for Travis, anyway, so I don't see a problem with the .travis.yml file corresponding to it.

Related fixes included in this commit:

* Allows capabilities, interfaces, and properties to override parent
definition types only if the new type is a descendant of the overridden
type
* Fix to get_property intrinsic function
* Fix the "required" field for parameters (it wasn't working)
* Don't let scalar values be negative
* Doc fixes related to ARIA-277
* Fix SSH tests
@asfgit asfgit merged commit 126d4e8 into master Sep 11, 2017
@asfgit asfgit deleted the ARIA-321-clearwater branch September 11, 2017 19:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants