-
Notifications
You must be signed in to change notification settings - Fork 29
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
Deploy to DockerHub #11
Comments
I think the main README needs a clean overview of the (new) links somewhere in the front - let me deploy the image after the README gets cleaned. I'm sorry, I'm now a little bit busy with another project but I'll check back from time to time. |
I think I'll continue with this next time |
I did some quick inventory. Right now on DockerHub, under the organization we have:
None of them seems to have publicity (i.e. mentioned on the wiki or elsewhere). Before I move the images to the organization, I think it would be a good idea to clarify some details:
I think the cleanest solution would be to move the djankiserv images into https://github.com/ankicommunity/docker-anki-sync-server/ and simply have different tags for them. What do you think? |
@kuklinistvan I totally agree with all your points and your solution. My current position is that we support both images but they will later by combined as the different projects are combined. As the actions, as I see them are:
Anything I missed. Once agreed, we can create separate issues for each one. And make this dependant as applicable. |
Rename to what? :) Got it otherwise, next time I'll continue this |
Hello, Yesterday I wrote a longer reply - but it seems that I have closed the browser window before hitting send. Long story short: I started moving things around, but I had trouble launching the server and building the Docker image. With time I will probably figure out how to do it on my own, but if you could wrote here a quick draft on how you usually build |
Have you set up automated builds into the dockerhub? |
Wow, I keep missing these messages... sorry @kuklinistvan :-(. https://github.com/ankicommunity/djankiserv/blob/master/scripts/buildimages.sh builds and uploads the images to the repo for the envvar |
BTW, the reason I haven't done any publicity or intend to do any is that I am really prejudiced against using straight docker. I see straight docker (with or without compose) as something you use if you have to use windows and don't have the memory to run a proper container orchestrator on your laptop. That's it. If you ever want to put something on a server you use an orchestrator. I provide a That said, at some point it might be nice to spin out the |
I have Void Linux installed on my laptop as of yet and use Docker, and actually prefer that way. I do not use Windows with this project.
Some people, including me, just want to get going with synchronization without diving deep into the technical details, and know how to run Also, I'm not against Kubernetes (yet :) - just kidding, hopefully I will discover in the near future what a fantastic solution it is) I simply don't have experience with Kubernetes and Helm, as of yet. As far as I know, Kubernetes can utilize Docker container images, but, I've only heard that somewhere. I'm completely okay with shipping to that platform as well - as long as we have the resources for that. However, in order to prioritize, I would be happy to have some data on how much of our audience is interested in a Docker-based and in a Kubernetes-based solution.
Yes, why? :) Again, I did not have the time yet to learn about Kubernetes, but that statement did sound to me something that is maybe a bit at the extremes, and would use some justification. |
And so is it true for I hardly think that you can skip these instructions just by using plain Helm: |
With the
Think of it like this. Right now you just need a gas-powered scooter to get down to the shops every couple of days. Sometimes it is a bit of a hassle but you can get by. I am used to using a Tesla - sure it is a bigger hassle to get started and purchase (learn, it's all free of couse :-)) - but once you know how to drive it, well, it pretty much drives itself. And then when you need to drive to the capital for the day you just get in the car and drive - you don't need to think about getting the train or a long-distance bus. Most importantly, I don't need |
TL;DR; You're both right. It just depends on what you want to do. I would suggest we create an Action Plan so we can agree on next steps. And a list of blockers and so we can get them resolved. @kuklinistvan I know you're doing a ton of tasks between this and the wiki so let us know how we can help. Adding my 2 cents to the conversation. I think they all have their own use cases. Personally I use all of the above depending on the project so here's my workflow.
3.5) Docker Swarm: I've never used it, but if that's your preferred method of orchestration, then you can deploy directly using your docker-compose file. I personally don't use it but the way I develop I'm perfectly happy for users to do that.
Now this approach has downsides. It's considerably more overhead. But I find it minimises the complexity so you can catch bugs earlier. And it also scales a lot better because each step is properly linted, tested, and versioned. |
Also for a name, tbh I don't really know. I've been thinking of a nice naming convention for all the repos but I wouldn't said it's the highest priority so let's just drop the |
Here's what I'm thinking for the Docker CI/CID pipeline
|
Thanks @automatedempire for your PR for Github Actions. The next step is to add the djankiserv docker image to the CI system. I'm not sure if the images works so that'll need to be checked also. Here are some advancements around this topic, which will eventually need to become their own tickets.
|
To add a data point to @kuklinistvan's question:
I had used docker-compose to build and run the anki-sync-server image on a Raspberry Pi, which worked for me for a nice long time. I'm currently working on building a K8s Pi cluster home lab (not done yet), and my eventual goal is to have a locally-hosted Anki sync server running as part of that.
I am currently working on updating the anki-sync-server workflow to match @VikashKothary suggestions above for deploying to Docker Hub and GitHub Container Registry based on branch. I almost have it (only took a small amount of refactoring my original idea), but I'm having some issues with testing the pushes to GHCR. Once I work through those, I'd be happy to move over to the djankiserv workflow.
I apologize, but I think I misunderstood something while reading across the different issues, which informed how I originally built the triggers for the first workflow. Are the ankicommunity/anki-sync-server and ankicommunity/djankiserv repos staying separate from this one? I thought they were being migrated under this repo in the services directory, making this the one repo to rule them all. If they are remaining separate, why are we building the devops services in this repo rather than beside the respective code? I want to make sure I understand the direction we're heading so I can build the workflow accordingly. |
Amazing! Thanks for taking the initiative on this. Much appreciated! So here's my vision, feel free to share your opinion.
The value here is a clear separation of concerns between development and operation, while allowing them to work together. The was a brief debate about whether this is the best process here: ankicommunity/ankicommunity-sync-server#69 but it was tabled for the sake of this issue. Does this makes sense? What are your thoughts? |
@automatedempire So I made a release, and it pushed to my personal dockerhub account. 😅 But other than that it worked great! Thanks so much for your hard work. So I think this is because you're using DOCKER_USERNAME for login and in the docker image name. My understanding is that I have to use my personal access token and personal username for the login. And there should be a separate variable for the docker image (or it can be hardcoded). How does that sound? |
Yep, that was a mistake on my part. I thought that variable would be the name of the org, but looking now, I can't find a way to generate an org access token. I tested this against a regular Docker Hub account (didn't have an org to test against, but I'll correct that), so I clearly missed it. I prefer it to be an environment variable to make development/testing easier, so I'll make a patch for this and submit another PR.
That direction makes sense to me, and I think that issue is where I got confused. I haven't done cross-repo actions before, but I'll look into it and build out that workflow as well under the other issue. |
Hey everyone! Just a friendly ping regarding ankicommunity/ankicommunity-sync-server#69. Is the cross-repo github action thing being considered/worked on? While doing it this way probably isn't ideal IMO (at least, I have never seen anyone do it this way), it should be possible. From some quick reading on this, it looks like we will need to do a repository_dispatch (https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#repository_dispatch). Let me know in case nobody is tackling this. I'll be happy to contribute. |
Hi @samyak-jain, as far as I am aware, the last update on this topic was in March as mentioned above. If you're happy to work on it, then I'm sure it'll be appreciated. I think we've still got the issue above where the GitHub Actions need to be modified to deploy to the Once that it set up, we can work on triggering a new build on a software release. Note one new approach I've come up with recently is to create an image in this repository that uses ARGS and ONBUILD to configure and copy the code, and then use it in the software repository's CI build. I feel like this would be closer to your original vision @samyak-jain, however, should share (almost) all the benefits of an cross-repo approach due to be developed separately. I just though I'd mention it if that's the path you want to take. |
Hey @VikashKothary. I think changing to the AnkiCommunity DockerHub account should be fairly straightforward. Are the secrets already configured? Do you know what are the names of the secrets I need to use? I am not sure I understand your proposal using ARGS and ONBUILD. Can you elaborate on that? If I'm understanding this correctly, you want to build an initial image in this repo which has ONBUILD which will then be used in another Dockerfile inside the anki-sync-server repo? Did I understand that correctly? I'm a bit confused on why this helps. |
|
And for the docker image, that's exactly right. It's just another approach that'll allow us to develop production-ready Dockerfiles in this repo while allowing for automatic deployments when a new release is created in the software repo. Both approaches allow us to cover all the complexities when developing Dockerfiles (see: ankicommunity/ankicommunity-sync-server#69 (comment)) as well as other issues that will appear in the future like supporting multiple architectures (#9) and supporting multiple cloud environments (#11 (comment)). That being said, we've been talking about this for a while, and it's clear you know your stuff so frankly I'm happy for you to complete this ticket however you see fit. Once we've got a working automatic deployment, we can obviously improve the process overtime. That sound good to you? |
I've made the change. So the anki-sync-server dockerfile should now be available in DockerHub. Thank you to everyone who helped contribute to this feature. I'm going to keep this issue open util I see a few pulls from Docker Hub to confirm it's working correctly. |
To the
AnkiCommunity
Org.The text was updated successfully, but these errors were encountered: