Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unique epaira interface names #232

Merged
merged 4 commits into from Oct 25, 2022
Merged

Conversation

grembo
Copy link
Collaborator

@grembo grembo commented Sep 17, 2022

This changes the code to rename the epaira side of interfaces to a unique value and stores it in the status file.

This has multiple advantages:

  • Removing the wrong interface highly unlikely
  • No need to poke into the running (or potentially dying) pot when stopping

Note that dual stack isn't covered yet (wasn't with the previous either).

@grembo
Copy link
Collaborator Author

grembo commented Sep 17, 2022

@pizzamig This is what this looks like

[root@host ~]# pot start cloneme
===>  Starting the pot cloneme
add net default: gateway 10.192.0.1
[root@host ~]# cat /tmp/pot_status_cloneme 
pot.status=started,p4632611c512510
[root@host ~]# ifconfig p4632611c512510
p4632611c512510: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
	description: cloneme
	options=8<VLAN_MTU>
	ether 02:ca:3c:ac:ce:0a
	groups: epair pot
	media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
[root@host ~]# pot stop cloneme
[root@host ~]#

@grembo
Copy link
Collaborator Author

grembo commented Sep 18, 2022

Dual stack example in action:

[root@host ~]# pot start -v cloneme
=====>  mount /opt/pot/jails/cloneme/m/tmp
===>  Starting the pot cloneme
add net default: gateway 10.192.0.1
rtsol: No answer after sending 3 RSs
[root@host ~]# pot stop -v cloneme
=====>  Stop the pot cloneme
=====>  Remove p4632706721649 epair network interfaces
=====>  Remove p6632706721649 epair network interfaces
=====>  unmount /opt/pot/jails/cloneme/m/tmp
=====>  unmount /opt/pot/jails/cloneme/m/dev

Copy link
Collaborator

@pizzamig pizzamig left a comment

Choose a reason for hiding this comment

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

small comments only

share/pot/start.sh Outdated Show resolved Hide resolved
share/pot/start.sh Show resolved Hide resolved
share/pot/start.sh Outdated Show resolved Hide resolved
share/pot/start.sh Show resolved Hide resolved
@pizzamig
Copy link
Collaborator

pizzamig commented Oct 3, 2022

@grembo Where are we with this?

@grembo
Copy link
Collaborator Author

grembo commented Oct 3, 2022

@grembo Where are we with this?

on vacation, but I can look into it soon

@pizzamig
Copy link
Collaborator

pizzamig commented Oct 3, 2022

No rush, when you are back! Enjoy your time off!

share/pot/start.sh Show resolved Hide resolved
@grembo
Copy link
Collaborator Author

grembo commented Oct 6, 2022

@pizzamig Did some basic tests after the latest change to confirm it still works (having some basic automatic tests would be great).

@pizzamig
Copy link
Collaborator

pizzamig commented Oct 7, 2022

In tests/CI there is a run.sh script, that perform a set of operation, using multiple configurations.
It was designed to run in an empty VM, with no pots (to easily check if all pots have been correctly destroyed after tests).
I will test this branch with this script later

@grembo
Copy link
Collaborator Author

grembo commented Oct 11, 2022

In tests/CI there is a run.sh script, that perform a set of operation, using multiple configurations. It was designed to run in an empty VM, with no pots (to easily check if all pots have been correctly destroyed after tests). I will test this branch with this script later

I implemented some pot testing for the FreeBSD sccache-dist patch (PR still pending): https://github.com/mozilla/sccache/pull/1184/files

I could adapt that to run these tests using github actions.

@grembo
Copy link
Collaborator Author

grembo commented Oct 21, 2022

@pizzamig I created #236 which allows us to run CI tests as a github action. Once this lands (and ci.yml is part of the master branch), I will rebase this issue and we can run the integration tests manually in github actions.

This changes the code to rename the epaira side of interfaces
to a unique value and stores it in the status file.

This has multiple advantages:
- Removing the wrong interface highly unlikely
- No need to poke into the running (or potentially dying)
  pot when stopping

Note that dual stack isn't covered yet (wasn't with the previous
either).
This changed the code to track multiple epais per running pot.
It also enable inet6 on the epair interface in the startup script.

I don't use pot with IPv6 myself, so I didn't test beyond
"interface is created, pot comes up, interfaces get destroyed".

It tries to get an IPv6 address using rtsol, DHCP6 support might
be nice in the future (or static IP handling by potnet).
However I managed to only to one part of the change.
@grembo
Copy link
Collaborator Author

grembo commented Oct 24, 2022

@grembo grembo merged commit ee59f6e into bsdpot:master Oct 25, 2022
grembo added a commit to grembo/pot that referenced this pull request Oct 25, 2022
grembo added a commit that referenced this pull request Oct 25, 2022
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.

None yet

2 participants