Code Monkey home page Code Monkey logo

Comments (13)

lpenz avatar lpenz commented on June 3, 2024 7

Github actions can use a URL with docker:// prefix to download built images from hub.docker.com.
Doing that would make actions run faster by bypassing building the image during the action.

from ansible-lint-action.

cognifloyd avatar cognifloyd commented on June 3, 2024 1

According to actions/runner-images#1445 (comment)

For publicly accessible containers we are working with docker hub to make sure you will not be impacted by the new rate limits. If you need private containers we still do not have a solution for that problem for forks of public repos.

So, relying on docker hub should not hit rate limiting in github actions (at least for public repos). :)

from ansible-lint-action.

ssbarnea avatar ssbarnea commented on June 3, 2024 1

No longer valid for version on main branch, where we use creator-ee container and no longer build our own.

from ansible-lint-action.

j0holo avatar j0holo commented on June 3, 2024

Great idea, does the Ansible team/maintainers want to host their own image on Docker hub or can we use an already existing one by a third party?

from ansible-lint-action.

lpenz avatar lpenz commented on June 3, 2024

I think the Dockerfile already present in this repository works fine.

from ansible-lint-action.

j0holo avatar j0holo commented on June 3, 2024

I get that, but the build image needs to be stored somewhere right? We could use the GitHub registry which is free but not usable for commonly used Action. Docker hub is an obvious choice, but then who will host it?

from ansible-lint-action.

adamrushuk avatar adamrushuk commented on June 3, 2024

@lpenz I'm interested in hearing more on this.

Looking through the documentation, do you mean change this line: https://github.com/ansible/ansible-lint-action/blob/master/action.yml#L45

to image: 'docker://<DOCKER_IMAGE>:<TAG>'

as per this example? https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#example-using-public-docker-registry-container

from ansible-lint-action.

lpenz avatar lpenz commented on June 3, 2024

That line is fine

What we need to change is the retrieval of the arguments - they have to be obtained from environment variables. I did that in here:
lpenz@fd26cb9
(I can make a pull request if people want)

After that, whoever owns the "ansible" user in hub.docker.com should set it up to build the image from this repository, "latest" from master and tag versions seems appropriate.

You can then use the image by specifying - uses: docker://ansible/ansible-lint-action:VERSION in a github workflow. The workflow will just download the image from hub.docker.com instead of building it every time.

from ansible-lint-action.

adamrushuk avatar adamrushuk commented on June 3, 2024

That would be great if the repo owners could implement similar so we wouldn't have to build every time. 👍🏼

from ansible-lint-action.

danielkubat avatar danielkubat commented on June 3, 2024

You can then use the image by specifying - uses: docker://ansible/ansible-lint-action:VERSION in a github workflow. The workflow will just download the image from hub.docker.com instead of building it every time.

I second that, especially when Ansible has already user on Docker hub with an images. (https://hub.docker.com/u/ansible). Based on my experience, building of Docker image every time consumes about 80-90% of entire GH Action runtime.

from ansible-lint-action.

cognifloyd avatar cognifloyd commented on June 3, 2024

I asked on #ansible-devel about who can get this onto dockerhub and I got two responses:

***sivel wonders why ansible-lint hasn't been moved out of the ansible org yet...
sivel: Should have been done a while ago

zbr: molecule container includes ansible-lint, https://github.com/ansible-community/molecule-dist
cognifloyd: Is that on dockerhub?
tadeboro: My guess would be quay.io since most of the semi-official ansible stuff ends up there.
cognifloyd: this image? https://quay.io/repository/ansible/molecule
zbr: yes, but i stopped refreshing it two weeks ago, we will restore the build pipelines.

The ansible/molecule container is currently 318.3MB
Another possible container, yokogawa/ansible-lint, is 94.98MB.
This uses python:3.8-slim (45MB) and the yokogawa one uses python:3-alpine (17.31MB), so the container could be optimized by using or following the example of the yokogawa container.

from ansible-lint-action.

bluikko avatar bluikko commented on June 3, 2024

@lpenz I would find a PR very helpful, it is very annoying that the action takes 3 minutes in building step...

from ansible-lint-action.

lpenz avatar lpenz commented on June 3, 2024

I've created a PR, here: #44

It's usable with docker://lpenz/ansible-lint-action:dockeraction, example: https://github.com/lpenz/ansible-playbooks/blob/ladatest/.github/workflows/main.yml

Result from that example: https://github.com/lpenz/ansible-playbooks/actions/runs/490558134

from ansible-lint-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.