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

better developer experience: ability to run tests inside docker containers #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vjayaramrh
Copy link
Contributor

The goal of this PR is to allow for developers (running on non linux systems such as MacBook and who do not have ovs/ovn installed) to be be able to run the tests in containers instead.
The PR creates a Dockerfile based off the openvswitch/ovn:2.12_e60f2f2_debian_master base image and adds go binaries. It also installs supervisord to help with running ovn-nb, ovn-sb and ovn-northd in the same container. (Refer http://supervisord.org/introduction.html)

Note: I have an enhancement request in the ovn-org/ovn repo requesting that official docker images for each of the OVN release to quay/docker repo (refer ovn-org/ovn#67)

Copy link
Contributor

@hzhou8 hzhou8 left a comment

Choose a reason for hiding this comment

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

Thanks @vjayaramrh
It seems the #121 is addressing the problem in a similar way. Could you take a look?
Please also see my comments.

@@ -0,0 +1,21 @@
FROM openvswitch/ovn:2.12_e60f2f2_debian_master
Copy link
Contributor

Choose a reason for hiding this comment

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

2.12 is rather old version, before OVS and OVN split.

Copy link
Contributor Author

@vjayaramrh vjayaramrh Jan 12, 2021

Choose a reason for hiding this comment

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

I used that image as the starting point as it was available in dockerhub at https://hub.docker.com/search?q=openvswitch%2Fovn&type=image, I am hoping that OVN images get regulary pushed as per the request at ovn-org/ovn#67 This dockerfile can be updated once the OVN release images gets published regularly, what do you think?


ARG GOVERPKG=go1.13.9.linux-amd64.tar.gz
RUN apt-get update
RUN apt-get install -y wget git gcc python3-pip python3-dev build-essential autoconf automake libtool
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the purpose of installing the tools such as gcc, python, build-essential, etc.?

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 test.sh script in the .travis folder needs them when executed inside the container

Copy link
Contributor

Choose a reason for hiding this comment

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

but according to the steps you put in README, the test.sh script is not used. Your approach is supposed to run "go test" directly.

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 README captures the native go way of running tests. Do you think that the README should also capture the alternate way i.e executing the .travis/test.sh? If you think that would be useful to capture as well, I can certainly update the README

command=/bin/start-ovn ovn-sb-tcp

[program:ovn-northd-tcp]
command=/bin/start-ovn ovn-northd-tcp
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems we don't need northd for go-ovn testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct, but convenient to have a running container built from this image that has all the relevant services running

@vjayaramrh
Copy link
Contributor Author

Thanks @vjayaramrh
It seems the #121 is addressing the problem in a similar way. Could you take a look?
Please also see my comments.

@hzhou8 appreciate you pointing this out, I have reached out to the PR author to have an initial discussion and look at ways for combining our efforts

@amorenoz
Copy link
Contributor

@vjayaramrh I think there are some interesting ideas here.
Using a pre-built image would definitely improve the developer experience.

For now, the container does build ovn, only ovs (for the ovsdb-server). The compatibility matrix with ovsdb should be relatively straight forward. But that might change as a result of the discussions in #29. So, when those discussions clear out the go-ovn -> ovn compatibility strategy looking forward, we could improve the current system by using pre-built images. wdyt?

@vpickard
Copy link

cc @vpickard

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.

4 participants