wireservice / csvkit

A suite of utilities for converting to and working with CSV, the king of tabular file formats.
https://csvkit.readthedocs.io
MIT License
6.03k stars 603 forks source link

Containerize / Dockerize csvkit #1240

Closed wesley-dean-flexion closed 4 months ago

wesley-dean-flexion commented 7 months ago

In #1239 I mentioned my work with MegaLinter. MegaLinter, in addition to supporting installs via npm, pip, etc., can also work with container images. A quick search on DockerHub seems to indicate that some folks have rolled their own csvkit images but it doesn't look like anything's being automatically generated. For example, I see that v1.5.0 is the most recent release (March 28, 2024) while the most recent image (on the first page of results on) DockerHub appears to be May 2nd, 2023 (almost a year ago).

So, babbling on, I've a workflow that I use to build and push images to GHCR, DockerHub, and Quay (all are optional) for several architectures (AMD64, ARM64, etc.):

https://github.com/wesley-dean-flexion/upload-sarif-to-defectdojo/blob/main/.github/workflows/publish.yml

The workflow is triggered by commits to main (configurable) updating the :edge tag of the images and GitHub releases triggering updates to :latest, versioned tags (e.g., v1, v1.5, and v1.5.0 in this case), etc..

If it would be helpful, I would be happy to submit a PR with it setup along with a Dockerfile to streamline the image build process.

If this isn't something that's interesting to you, that's totally cool. I don't want to make any more work for you than you've already got.

Thanks again!

jpmckinney commented 7 months ago

Could you start with authoring the Dockerfile?

My workflow would tend to be much simpler e.g. adding a condition to only run on tags to this workflow: https://ocp-software-handbook.readthedocs.io/en/latest/docker/build.html

wesley-dean-flexion commented 7 months ago

I would be happy to do so. I'll have a PR for you fairly shortly.

wesley-dean-flexion commented 7 months ago

I've a Dockerfile builds an image that clocks in at 135MB with the v2.0.0 release. I just need to fork and create a PR.

wesley-dean-flexion commented 6 months ago

I'll be adding another PR to incorporate publishing the images in the next few days.

wesley-dean-flexion commented 6 months ago

@jpmckinney I added #1245 as a draft PR as #1240 needs to be merged first (#1245 includes a Dockerfile that's defined in #1240). I'm happy to walk through the PR and the configuration mentioned there if that's helpful.

No rush. Never a rush.

jpmckinney commented 6 months ago

Thank you! I'll take a look through once I have a moment.

jpmckinney commented 4 months ago

I finally had a chance to look at it. Try: docker pull ghcr.io/wireservice/csvkit:latest

wesley-dean-flexion commented 4 months ago

This is Awesome! THANK YOU!!!

jpmckinney commented 4 months ago

Yay :) I'll close this issue for now, but if anything needs to be changed (e.g. adding more tags, etc.) we can follow up in new issues or PRs.