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

Enable continuous integration with Travis CI #175

Merged
merged 17 commits into from
Feb 6, 2020

Conversation

gabrielepmattia
Copy link
Contributor

@gabrielepmattia gabrielepmattia commented Jan 31, 2020

This PR is for enabling Travis CI to auto-build Fog05. CI will allow understanding if the build process succeeds in a clean environment. This contribution must consist of:

  • creating a build.sh file for automating the build (copying the instructions from BUILD.md)
  • updating the .travis.yml file for installing dependencies
  • making the build process happen in a Debian docker container (GitLab CI style)

Please do not merge this PR until a successful build is obtained. Build log can be seen here.

Latest build of the merging branch:

status

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
@gabrik
Copy link
Contributor

gabrik commented Feb 3, 2020

Hi @gabrielepmattia,
Thanks for this PR, we already had the travis integration for each component but it was missing on the main repo.

I guess I have to merge it to see if it actually builds right?

@gabrielepmattia
Copy link
Contributor Author

Hi @gabrik, there's no need to merge for seeing if it is building correctly since the build is triggered on my branch https://github.com/gabrielepmattia/fog05/tree/add-ci-script (that is even with master) and the current status can be seen here https://travis-ci.org/gabrielepmattia/fog05

I would wait to merge until we get a successful build, then I would create a tag with the version (perhaps a beta version, like 0.0.1b), in this way we can create and ship an installable .deb for Debian 10.

Now I'm trying to switch to dune 1.11.4

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
@gabrik gabrik self-assigned this Feb 3, 2020
@gabrik
Copy link
Contributor

gabrik commented Feb 3, 2020

I was looking at the logs, and It cannot find the build.sh even if it is here.
My guessing is that it clones a wrong repo/branch

@gabrielepmattia
Copy link
Contributor Author

Yes, because we didn't merged the branches, follow the logs here https://travis-ci.org/gabrielepmattia/fog05

@gabrielepmattia
Copy link
Contributor Author

gabrielepmattia commented Feb 3, 2020

We still get the same error https://travis-ci.org/gabrielepmattia/fog05/jobs/645485319#L1654 (this link should open you the log line with the error) do you mind if we switch to the install command dune install instead of opam install in build.sh? Otherwise how we can solve this problem?

@gabrik
Copy link
Contributor

gabrik commented Feb 3, 2020

Hi see, actually, for some reason I can see that when installing apero-core dune gets updated https://travis-ci.org/gabrielepmattia/fog05/jobs/645485319#L1535
I guess I can fix it because I have access to that repo.
I'll do that and then I'll update you in this PR.

@gabrik
Copy link
Contributor

gabrik commented Feb 4, 2020

I have fixed the dependency repository, just restarted the build to check if it works

@gabrielepmattia
Copy link
Contributor Author

So we need to git checkout to master apero-core?

@gabrik
Copy link
Contributor

gabrik commented Feb 4, 2020

Nope, same tag, I have removed the old tag and created a new one with the fix.

@gabrielepmattia
Copy link
Contributor Author

Perfect

@gabrielepmattia
Copy link
Contributor Author

It seems that apero-core depends on ocaml < 3.07 https://travis-ci.org/gabrielepmattia/fog05/builds/645485318#L1534

@gabrik
Copy link
Contributor

gabrik commented Feb 4, 2020

My bad, I have done a mistake in the opam file.
Just fixed it, please retry the build and let me know.

@gabrielepmattia
Copy link
Contributor Author

gabrielepmattia commented Feb 4, 2020

Okay, but see this issue before that eclipse-archived/api-ocaml#5

@gabrielepmattia
Copy link
Contributor Author

Can you merge your branch with https://github.com/eclipse-fog05/api-ocaml since this repo is bound to it

@gabrik
Copy link
Contributor

gabrik commented Feb 4, 2020

Done! I was waiting for the build to work before merging.
Please let me know if there are any other issue

@gabrielepmattia
Copy link
Contributor Author

Seems that "atdgen" library is missing https://travis-ci.org/gabrielepmattia/fog05/jobs/645850828#L1892

@gabrik
Copy link
Contributor

gabrik commented Feb 4, 2020

Seems that "atdgen" library is missing https://travis-ci.org/gabrielepmattia/fog05/jobs/645850828#L1892

I see I have no right to touch that repository, I suggest that for atdgen we install it before installing the dependencies. Same for conf-libev and ocp-ocamlres

You can just add those to https://github.com/gabrielepmattia/fog05/blob/add-ci-script/.travis.yml#L18

it would become

- docker exec build opam install dune.1.11.4 atdgen.2.0.0 conf-libev  ocp-ocamlres -y

Also as you are building in a container with the sandboxing disabled, you can avoid to install bubblewrap

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
@gabrik
Copy link
Contributor

gabrik commented Feb 5, 2020

I see this: https://travis-ci.org/gabrielepmattia/fog05/builds/646060107#L2531
Can you try to run that command inside the container before the execution of build.sh?

@gabrielepmattia
Copy link
Contributor Author

Yes, but I see that there is another dependency when installing z_storage package https://travis-ci.org/gabrielepmattia/fog05/builds/646060107#L1900

@gabrik
Copy link
Contributor

gabrik commented Feb 5, 2020

That's not an issue, the z_storage is an example package, even if it fails the installation of the other dependencies just works fine.
The only issue I see is that the shell does not find dune.

I have also some question on the build of the debian packages, but I think we can discuss about it later once the build is working.

@gabrik
Copy link
Contributor

gabrik commented Feb 5, 2020

I'm running the same CI build on a local machine to verify why inside the container it does not find opam.

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
@gabrielepmattia
Copy link
Contributor Author

Done, I fixed it. The dollar sign gets interpreted outside the container

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
@gabrik
Copy link
Contributor

gabrik commented Feb 5, 2020

@gabrielepmattia I tested on a local docker, following as possible the travis CI
I got it working by changing https://github.com/gabrielepmattia/fog05/blob/add-ci-script/.travis.yml#L24 with:

- docker exec build bash -c "opam env > .opamprofile && source .opamprofile && cd fog05 && ./build.sh"

I guess it is worth a try

@gabrik
Copy link
Contributor

gabrik commented Feb 5, 2020

I see it passing! Congrats @gabrielepmattia

@gabrielepmattia
Copy link
Contributor Author

gabrielepmattia commented Feb 5, 2020

Perfect, it successfully builds. Can we merge this PR or do we also want to create a deb package at the end of the building phase?

@gabrik
Copy link
Contributor

gabrik commented Feb 5, 2020

I can merge it.
Regarding the deb package, It would be nice to have them, but it is worth knowing that a postinst script is required and we cannot have only one single deb.

Ideally we should have something the ones hand-crafted in this repo: https://github.com/atolab/fog05_debs

In this case, I guess that the agent+yaks+linux_plugin one can be done in this repo, while the other ones should be built by the CI of the other repositories.

This means that I will update the other repositories to have a CI that follows the one of this repo.

@gabrielepmattia please fell free to joint the gitter channel https://gitter.im/atolab/fog05 so we can discuss about this ;)

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
@gabrielepmattia
Copy link
Contributor Author

gabrielepmattia commented Feb 6, 2020

Perfect! Congrats even to you!

Before merging I would make other edits:

  • in BUILD.md we can tell to run build.sh
  • I would move the installation of dune, atdgen and other missing libraries in build.sh since they are susciptible to change

For debs I would open another PR, and in this repo I would build only the agent since other components like yaks and linux_plugin have different repository and they can be updated independently from the fog05 agent, I guess

After these changes and this merge you can create a tag with the latest version of the agent, so we have a checkpoint

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
@gabrik
Copy link
Contributor

gabrik commented Feb 6, 2020

@gabrielepmattia please ping me when I can merge this

@gabrielepmattia
Copy link
Contributor Author

Done, I think we are ready to merge

@gabrik gabrik merged commit b09c130 into eclipse-fog05:master Feb 6, 2020
@gabrik
Copy link
Contributor

gabrik commented Feb 10, 2020

@gabrielepmattia I have just created a pre-release tag v0.1.0.pre-release that can be used if you want to go ahead with the build of deb packages.

gabrik pushed a commit that referenced this pull request Nov 26, 2020
* Add travis ci script and build.sh

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Switched to dune 1.11.4

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Fixed typo in travis script

* Updated sdk-ocaml git submodule dependency

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Updated api-ocaml git submodule

* Added other opam deps in travis and removed bubblewrap

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Enable opam env after install in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Fixed opam env eval in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Load opam in bashrc in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Reload opam environment when building

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Temporary reinstall dune in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Trying to fix building with opamenv in ci

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Removed useless line in ci script

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Removed useless line and improved build line

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Moved installing other opam dependencies in build.sh

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Updated BUILD.md documentation

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>

* Typo in BUILD.md documentation

Signed-off-by: Gabriele Proietti Mattia <pm.gabriele@outlook.com>
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