DerwenAI / kglab

Graph Data Science: an abstraction layer in Python for building knowledge graphs, integrated with popular graph libraries – atop Pandas, NetworkX, RAPIDS, RDFlib, pySHACL, PyVis, morph-kgc, pslpython, pyarrow, etc.
https://derwen.ai/docs/kgl/
MIT License
574 stars 65 forks source link

CI action to add `kglab` to DockerHub #230

Closed ceteri closed 2 years ago

ceteri commented 2 years ago

Let's add a CI action in GitHub to update a container image in DockerHub

This will help people who want to run the our notebook-based tutorial from DockerHub, i.e., what we use for the conference workshops.

RishiKumarRay commented 2 years ago

@ceteri i would like to do this

ceteri commented 2 years ago

Many thanks @RishiKumarRay, that's great!

We have an account: https://hub.docker.com/u/derwenai/

Please let me know what you need. For next steps, is it best for us to set up GitHub secrets for the DockerHub credentials? We haven't needed to before, but I can do that.

RishiKumarRay commented 2 years ago

@ceteri for next steps can you please add the secrets in the repo , like the username and token for dockerhub and tell me the names you used so that i can add them in the workflow.

ceteri commented 2 years ago

Just added two repo secrets:

There is a repo https://hub.docker.com/r/derwenai/kglab although I haven't loaded any images yet.

RishiKumarRay commented 2 years ago

@ceteri I tried testing the github actions by using my dockerhub credentials as from fork your credentials are not accessible. So i see there is a image pushed which confirms that github actions is working correctly. So i will just change the credentials name with yours and it will work on yours too. You can check the image here https://hub.docker.com/repository/docker/rishiray/kglab

also you can check the github actions that i have written and tested here https://github.com/RishiKumarRay/kglab/runs/5490986719?check_suite_focus=true

let me know what you think and we can proceed accordingly.

ceteri commented 2 years ago

That's great @RishiKumarRay !

Next, how about, do you want to do a PR with the credential names switched to DerwenAI's, with the docker.yml tasks added into .github/workflows/ci.yml ? Then a PR merge will test it.

RishiKumarRay commented 2 years ago

@ceteri yeah sure i will raise a PR and you can test that and i am there to help

RishiKumarRay commented 2 years ago

@ceteri should i add the tasks in ci.yml or should i create a new file? how you want the things?

ceteri commented 2 years ago

Good point.

Best to have that as a separate file, and trigger on a release published: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release since we want to build/push the DockerHub images on each new release.

RishiKumarRay commented 2 years ago

@ceteri then in that case , you might be needed a tag so that whenever you tag the release then that release tag should be the tag of the image pushed instead of latest ?

RishiKumarRay commented 2 years ago

@ceteri i have raised A PR doing all the changes , make sure the credentials you have entered is correct and in docker password you have kept the token with proper permissions so that it can login and push the image. Also you can try creating a release with the tag whatever you want and you will notice that, tag will be the docker image tag wich will be pushed to the repo. Let me know if there is any error , i will try to help.

ceteri commented 2 years ago

Fantastic, that's all in place now:

Many thanks @RishiKumarRay !!

RishiKumarRay commented 2 years ago

@ceteri Happy to help! Let me know in future if you need any issue to be resolved using devops tools