Skip to content

Refactor image usage#2

Open
HansZimmer5000 wants to merge 8 commits intoederollora:mainfrom
HansZimmer5000:contribution
Open

Refactor image usage#2
HansZimmer5000 wants to merge 8 commits intoederollora:mainfrom
HansZimmer5000:contribution

Conversation

@HansZimmer5000
Copy link

(Copy due to source branch change)

My masters thesis kicks off and I enjoyed your create script very much +1 ! Maybe we can work on these type of scripts together. :)
Until I knew of this script I tried it by myself which was quite awful (tried to reconstruct what they did on their v1.15 tutorial VM with their usage of custom scripts & settings).

The changes regarding pulling are not really necessary, they just prevent a (maybe) not needed docker pull.
This is handy in regard to the new docker hub pull limits and it prevents an error message in the case you are using a custom $onosImage that is only available locally.

@HansZimmer5000 HansZimmer5000 changed the title Contribution Refactor image usage Nov 12, 2020
@ederollora
Copy link
Owner

I had some issues with the current state of the contribution. I will try to see tomorrow how to fix it.

Here the error:

:~/ONOS_autocluster$ ./create_cluster.sh -o 2.3.0 -a 3.1.5 -i 3 -j 5
atomix-version: 3.1.5
onos-version: 2.3.0
atomix-containers: 3
onos-containers: 5
subnet: 172.20.0.0/16
Pulling atomix/atomix:3.1.5
Pulling onosproject/onos:2.2.1
Traceback (most recent call last):
  File "./onos/tools/test/bin/atomix-gen-config", line 115, in <module>
    local_member_id = get_local_node(args.node)
  File "./onos/tools/test/bin/atomix-gen-config", line 54, in get_local_node
    return 'atomix-{}'.format(ips.index(node) + 1)
ValueError: '' is not in list
Error: No such container:path: atomix-1:/opt/atomix/conf
Error response from daemon: No such container: atomix-1
Error: failed to start containers: atomix-1
Starting container atomix-1
Traceback (most recent call last):
  File "./onos/tools/test/bin/atomix-gen-config", line 115, in <module>
    local_member_id = get_local_node(args.node)
  File "./onos/tools/test/bin/atomix-gen-config", line 54, in get_local_node
    return 'atomix-{}'.format(ips.index(node) + 1)
ValueError: '' is not in list
Error: No such container:path: atomix-2:/opt/atomix/conf
Error response from daemon: No such container: atomix-2
Error: failed to start containers: atomix-2
Starting container atomix-2
Traceback (most recent call last):
  File "./onos/tools/test/bin/atomix-gen-config", line 115, in <module>
    local_member_id = get_local_node(args.node)
  File "./onos/tools/test/bin/atomix-gen-config", line 54, in get_local_node
    return 'atomix-{}'.format(ips.index(node) + 1)
ValueError: '' is not in list
Error: No such container:path: atomix-3:/opt/atomix/conf
Error response from daemon: No such container: atomix-3
Error: failed to start containers: atomix-3
Starting container atomix-3
Creating atomix-1 container with IP: 172.20.0.2
Creating atomix-2 container with IP: 172.20.0.3
Creating atomix-3 container with IP: 172.20.0.4
Starting onos1 container with IP: 172.20.0.5
Starting onos2 container with IP: 172.20.0.6
Starting onos3 container with IP: 172.20.0.7
Starting onos4 container with IP: 172.20.0.8
Starting onos5 container with IP: 172.20.0.9
Copying configuration to onos1
Restarting container onos1
Copying configuration to onos2
Restarting container onos2
Copying configuration to onos3
Restarting container onos3
Copying configuration to onos4
Restarting container onos4
Copying configuration to onos5
Restarting container onos5

@HansZimmer5000
Copy link
Author

HansZimmer5000 commented Nov 15, 2020

Pretty sure I know what causes this...
Will try to fix it, thanks!

@HansZimmer5000
Copy link
Author

HansZimmer5000 commented Nov 15, 2020

Fixed now, problem was that I called the functions in "main" in the wrong order and that I gave the atomix ips for "atomix-gen-config" as a single string.

Additional problems (that are mentioned here for completness):

  1. When you have "OCC" env vars set, the atomix-gen-config script will not try to read from your "OC" env vars you exported in this script.
  2. The first problem would not be a problem if the atomix-gen-config script would use its given arguments. The config script forgets the "args.nodes" for "get_local_node", which should be "get_local_node(args.node,args.nodes)". With that set the script would not read OCC/OC env vars and instead rely on the given arguments. Will create a bug + fix for the onos project in the next days so hopefully this will not be an issue in the future.

EDIT: After some reading and the initial setup I created a Jira Ticket and uploaded the Fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants