Vauxoo / runbot-addons

Runbot Custom Features to be used by community.
GNU Affero General Public License v3.0
3 stars 7 forks source link

[IMP] Add module to create builds with imagen of orchestv #160

Closed mapuerta closed 6 years ago

mapuerta commented 6 years ago

For more information see the issue

This MR depends of this MR

coveralls commented 6 years ago

Coverage Status

Coverage increased (+7.03%) to 61.919% when pulling dd5e255764487babf87920cf70b149dba4c032e5 on vauxoo-dev:11.0-fix#426-mapuerta into 92d79ae48e1ad3f30039a8ea99bb12a55f2751c0 on Vauxoo:11.0.

codecov-io commented 6 years ago

Codecov Report

Merging #160 into 11.0 will increase coverage by 7.02%. The diff coverage is 89.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##             11.0     #160      +/-   ##
==========================================
+ Coverage   54.89%   61.91%   +7.02%     
==========================================
  Files           9       13       +4     
  Lines         552      688     +136     
==========================================
+ Hits          303      426     +123     
- Misses        249      262      +13
Impacted Files Coverage Δ
runbot_travis2docker/models/runbot_build.py 78.26% <0%> (ø) :arrow_up:
runbot_docker/models/runbot_branch.py 100% <100%> (ø)
runbot_docker/controllers/runbot_hook.py 57.14% <57.14%> (ø)
runbot_docker/models/runbot_build.py 90.47% <90.47%> (ø)
runbot_docker/models/runbot_repo.py 95% <95%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 92d79ae...dd5e255. Read the comment docs.

mapuerta commented 6 years ago

@moylop260 @ruiztulio Please can you check this.

See Video

ruiztulio commented 6 years ago

@mapuerta good job. @moylop260 don't we have to build and push the image from travis and then deploy it in runbot? so we have it available for deploying the exact same image in orchest. As discussed here:

image

We have that implemented in the gitlab pipeline:

a

It builds and push the image to quay.io:

b

ATM it only works with the main branch, but I think we should make it a global (github and gitlab) standar and for all the MRs and PRs so that the image is built only once, pushed and no matter where we deploy it it will the exact same one, we could even deploy it locally (I'm working in a couple solutions to make it easier)

What do you think guys (@nhomar @mapuerta @moylop260 @Angelfentanez )?

nhomar commented 6 years ago

@mapuerta Please rebase when you can @ruiztulio agree.

mapuerta commented 6 years ago

@nhomar I am making the changes suggested by @moylop260. I almost finished them and push the changes

mapuerta commented 6 years ago

@moylop260 @ruiztulio Ready for review

Configure repo of image quay.io See video

Configure Web hook. Video

moylop260 commented 6 years ago

Add a tests similar to https://github.com/Vauxoo/runbot-addons/blob/f59f0ef75924107badbbb67e09de9fd16468c426/runbot_travis2docker/tests/test_runbot_build.py#L95

moylop260 commented 6 years ago

Just download images filtered with runbot.runbot_max_age

moylop260 commented 6 years ago

Please, fix all imported and unused packages: https://travis-ci.org/Vauxoo/runbot-addons/jobs/369261771#L721

mapuerta commented 6 years ago

@moylop260 @ruiztulio Ready for review

ruiztulio commented 6 years ago

@mapuerta Sabes que estamos planeando tener builds por cada PR/MR para usar esas imagágenes, pero también tenemos planeado eliminarlas cuando ya no las necesitemos (se haga el merge o se cierre), ¿El runbot se encargará de eliminar esas instancias también? No es requerido, pero supongo que eso bajaría la carga que tiene runbot y ayudaría a mantenerlo limpio.

@moylop260

moylop260 commented 6 years ago

Entiendo que "cuando no se necesiten" te refieres a cuando la PR ya esté mezclada, como hace actualmente deployv.

Ok, hay que hacerlo compatible con gitlab y con github. También necesitamos que si hay 2 o más builds para la misma PR mate todas las demás, y deje solo la última viva.

Pero este módulo tendría que ser uno separado, porque aplica para todo runbot runbot_clean or something similar.

Por lo pronto lo que hace runbot es que va matando las más viejas, acorde a su capacidad, automáticamente, así viene de caja y no le hemos movido a eso, pero sí hay una área de oportunidad enorme ahí.

moylop260 commented 6 years ago

FYI I ran the tests locally and it's not working...

mapuerta commented 6 years ago

@moylop260 Ready for review

moylop260 commented 6 years ago

Running the tests I saw that the command ran into the container is:

... -i None ...

moylop260 commented 6 years ago

In order to get the tests from a PR you should upload a basic image as public (Not quay.io login required) It allow us see the coverage for each PR and avoid the errors that I saw for each review.

mapuerta commented 6 years ago

@moylop260 Ready for review