-
-
Notifications
You must be signed in to change notification settings - Fork 273
-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
code-server-golang #35
Comments
Created coder/code-server#1585 for the code-server PATH issue. |
Thanks, for the work. It looks good. However, since it's just a binary, wouldn't it be better to grab the binary in the docker file and inject it rather downloading it during container start? That way, we could push versioned mod images onto docker hub and users can define the version as a tag. See how we did it for powershell here: https://github.com/linuxserver/docker-mods/blob/code-server-powershell/Dockerfile And travis pushes versioned images here: https://github.com/linuxserver/docker-mods/blob/code-server-powershell/.travis.yml#L29-L37 We use a jenkins trigger that monitors the upstream releases and can trigger a travis build with the upstream version Also with regards to the PATH issue, I can't reproduce it here. I open a new browser window, open code server and in the terminal that is open I do |
It's a tarball with an entire golang install... but I see what you're saying and I think it could still work. How would the Jenkins trigger work? You'd trigger off the github source release and have it download the prebuilt binary from dl.google.com? Google doesn't publish the binaries to github but if Travis/Jenkins are passing in the github release version as like As far as the PATH issue, yes that the right path by default. But I'm adding |
I should have just looked at the travis yaml... okay yea.. I can make this work just in the Dockerfile and a simple extract script. |
One question though, how would we handle the different version tracks? Golang still maintains the 1.12 1.13 and 1.14 versions and we wouldn't really want a :latest tag in the mod to flip users who have been working in golang 1.14 down to 1.12 if they release a new 1.12 update after 1.14 simply because it's the last release in github. Ideally we'd have tags like so: The major.minor tag will track the latest release of that major.minor version. latest will always track the newest version of golang. I'm not sure how that would work in your setup, I've seen it done for other images though so I'm certain it's possible. |
Yes, the For PATH, try placing your new PATH export into the service run file and see if that fixes it (make sure to use With regards to versioning, yes, we can do tags for major.minor with a simple edit to travis yml. Not sure if we can do Jenkins trigger will do hourly checks for new versions and if there is one, it will fire off a new build with the build arg for version. |
So I've been looking at trying to get the latest release from the github API and it appears that the golang/go repo is not behaving like a regular repo. For example, in Powershell this works: This doesn't work for the golang repo: Looking at all the releases: The API returns an empty list. I'm not sure how Jenkins triggers work. If you can use regular shell scripts to output a version then that would work... but if it relies on the github API and those API endpoints I'm not sure it'll work. I've updated my repo to use Docker build args for the version as suggested. I'm still playing with the PATH issue. I got it working by adding the PATH to the code-server/run file and am just verifying it all with fresh clean images before I commit that. |
PATH issue has been fixed and I've updated my repo https://github.com/n-i-x/codeserver-golang-mod and published my mod to nixapps/codeserver-golang:latest Give it a try and let me know how I should proceed. |
Apologies for the radio silence. I got sidetracked with other projects. I'll look into this later today and figure it out EDIT: Took a quick glance at the downloads website and the git tags and here's a draft proposal: The only part I'm concerned with (long term concern) is I don't know the order in which the devs update the website and the git tags. If they're about the same time, it should work fine. But if there is a long delay between git tag and the website update, a new latest build may be missing the Thoughts? @n-i-x |
Played around a little more and unfortunately, the tags on github are not returned through any api commands I tried. Only the weekly tags from back in 2012 are returned. The original git repo on google's website also doesn't seem to have any sort of api (I couldn't find one). So I looked into grabbing all releases from the website instead. Here are some curl/grep commands I put together to retrieve them: latest stable amd64 version (featured): latest 1.14 version: latest 1.13 version: and this will retrieve the latest release (stable or not): I'll put them into a version check and trigger script |
Yep, that's what I found out as well. I wanted to use the git tags/releases in my download script and ended up resorting to parsing the latest amd64 download if the GO_VERSION build arg isn't specified. I went a little more specific in my regex to only match digits.. but this stuff is usually templated from Google so I doubt the regexes will stop working unless there is a complete refresh of the site. I'm glad travis/jenkins is able to trigger off a regular script to make this possible. Tracking the supported versions will be useful to people as not everyone works on projects using the latest go versions. |
got the travis.yml working to push major/minor/patch tags: https://hub.docker.com/r/aptalca/mods/tags I'll get the jenkins trigger sorted shortly |
Looks good.. were you able to figure out how to target a specific version or the latest for that track? Latest 1.13: 1.13 1.13.10 So the "1.13" tag moves to the latest 1.13 release. So if you want to track Go 1.13 you just use :1.13 and you'll always have the latest release but if you need to do a test or your project is tied to a very specific go version you can still use the 1.13.9 tag? I'm pretty sure if you apply an existing tag to a newer release docker hub does the right thing so you'd just need to apply the major.minor.patch tag and the major.minor version tag to each release. |
yes, you can use the tags EDIT: Well, since all mods are published at the same repo, the tags are technically prefixed with |
That's perfect! |
Ugh, great. Right after I pushed my final draft, I realized they don't exactly follow major minor patch format for their releases as they released Anyways, it's here for now: https://github.com/linuxserver/docker-mods/tree/code-server-golang-dev |
Alright, fixed it. It will push |
@n-i-x thanks for your work. It is merged and the mod is pushed to the hub. I manually triggered builds for the latest of 1.14, 1.13, 1.12 and 1.11. From now on, it will build all new releases automatically. The jenkins trigger will check daily: https://ci.linuxserver.io/job/External-Triggers/job/code-server-golang-external-trigger/ Don't forget, you're the maintainer for this mod 😁 |
Awesome! Thanks for your help! I use code-server with go daily so no problems :) At least now I can just send PRs. |
@n-i-x discovered another issue. When go publishes releases, it does them all at once. But our trigger only checks the latest one. So 3 days ago, it picked up 1.14.3, but not 1.13.11 because they were releases at the same time. I'll have to adjust the trigger to check the last 3 releases or something like that. |
Alright, I updated the daily trigger so it checks the latest 3 versions released against the built images. As long as go releases no more than 3 versions in a 24 hour period, we're good. If they do, I'll increase it. Let's keep an eye on it. |
just add a new environment variable |
# This is the 1st commit message: Updated requirements in the Readme to mention docker dependencies # This is the commit message linuxserver#2: Improve the way mod behaves after restart where config directory disappears by recreating the config file (prevent unneccesary update in the api) # This is the commit message linuxserver#3: debug # This is the commit message linuxserver#4: fix # This is the commit message linuxserver#5: fix # This is the commit message linuxserver#6: fix # This is the commit message linuxserver#7: fix # This is the commit message linuxserver#8: fix # This is the commit message linuxserver#9: fix # This is the commit message linuxserver#10: Refactor whole code (same functionality) # This is the commit message linuxserver#11: fix # This is the commit message linuxserver#12: fix # This is the commit message linuxserver#13: fix # This is the commit message linuxserver#14: fix # This is the commit message linuxserver#15: fix # This is the commit message linuxserver#16: fix # This is the commit message linuxserver#17: fix # This is the commit message linuxserver#18: fix everything with pylint # This is the commit message linuxserver#19: fix # This is the commit message linuxserver#20: fix # This is the commit message linuxserver#21: fix # This is the commit message linuxserver#22: fix # This is the commit message linuxserver#23: fix # This is the commit message linuxserver#24: fix # This is the commit message linuxserver#25: fix # This is the commit message linuxserver#26: fix # This is the commit message linuxserver#27: fix # This is the commit message linuxserver#28: fix # This is the commit message linuxserver#29: fix # This is the commit message linuxserver#30: added monitor param # This is the commit message linuxserver#31: added support for notifications # This is the commit message linuxserver#32: fix # This is the commit message linuxserver#33: fix # This is the commit message linuxserver#34: fix # This is the commit message linuxserver#35: fix # This is the commit message linuxserver#36: fix # This is the commit message linuxserver#37: added note about defaults
I've created a golang mod for code-server that I'd like to send a PR for.
Please create a new branch for me to send you a PR.
My repo is located at https://github.com/n-i-x/codeserver-golang-mod and currently published to nixapps/codeserver-golang:latest
There seems to be a code-server bug where the initial terminal doesn't have its PATH set properly, but opening a new one does so I'm not sure what to do about that aside from opening up an issue with code-server.
The text was updated successfully, but these errors were encountered: