Skip to content
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

Add linode provider #15

Merged
merged 14 commits into from
Jan 28, 2024
Merged

Conversation

guisea
Copy link
Contributor

@guisea guisea commented Aug 29, 2023

This is an implementation of a driver for Linode.

@guisea
Copy link
Contributor Author

guisea commented Aug 30, 2023

As a note. The "user-data" in this driver is a bash script to do the same job as the Hetzner driver which uses cloud-init.

I battled for a long time (days) to get this working with cloud-init on Linode. However there is something funny with Linode config I could not iron out. As a workaround utilizing their "StackScripts" implementation we can create agents on demand.

A public "StackScript" I have created allows this to happen from the Linode end.

@anbraten
Copy link
Member

anbraten commented Aug 30, 2023

Thanks for the work. The code looks pretty well already. I just need to test it.

I just found this community post regarding cloud-init support:

@anbraten anbraten mentioned this pull request Aug 30, 2023
15 tasks
@guisea
Copy link
Contributor Author

guisea commented Aug 30, 2023

Thanks for the work. The code looks pretty well already. I just need to test it.

I just found this community post regarding cloud-init support:

Haha, yeah. That looks promising. But seems to have been coming for years already. Being in NZ I deploy resources in the closest GEO which is not in the Beta sadly. The StackScript/Bash solution works no matter anyway. I was using for a time this kind of method to get around the shortfall while using Drone Autoscaler. I did code a linode driver for that too some long time back ;) Never released it, was not sure of their licensing model. But after banging ones head re: cloud-init you just give up and find something that works and this is where the bash implementation sits ;)

@anbraten anbraten changed the title Implement linode driver Add linode provider Aug 30, 2023
Copy link
Member

@anbraten anbraten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They added cloud-init to more regions now, so maybe it is already supported in your region as well. Apart from that it lgtm.

go.mod Outdated Show resolved Hide resolved
@guisea
Copy link
Contributor Author

guisea commented Nov 10, 2023 via email

@anbraten
Copy link
Member

Not sure myself either is a direct dependency. I will check out the cloud-init again in a few days should I get time.

Awesome. Sorry for the long silence 🙈 Just poke me if I am missing it again.

@6543
Copy link
Member

6543 commented Nov 21, 2023

could you merge master into the feature branch :)

@runephilosof-karnovgroup

Metadata/userdata/cloud-init is accessible to everything running on the agent, not only root.
https://www.linode.com/docs/products/compute/compute-instances/guides/metadata/#access-the-metadata-service-api

So you should not save the woodpecker token in that.

I could not find anything in the documentation about how the stackscripts are retrieved by the machine on boot.

@runephilosof-karnovgroup

So you should not save the woodpecker token in that.

Unless the tokens are one-time use, I haven't looked into that.

@6543
Copy link
Member

6543 commented Jan 27, 2024

#15 (comment)

@guisea
Copy link
Contributor Author

guisea commented Jan 27, 2024

go mod tidy run against this branch and pushed. Is now correctly shown as direct dependency

@6543 6543 added the feature Add new feature label Jan 27, 2024
6543
6543 previously approved these changes Jan 27, 2024
@6543
Copy link
Member

6543 commented Jan 27, 2024

"... This branch has conflicts that must be resolved ..."

Can you merge target branch into pull head branch :)

@guisea
Copy link
Contributor Author

guisea commented Jan 28, 2024

Hows this now? I have merged changes from main and updated the provider to go.woodpecker-ci.org/woodpecker/v2
@6543 @anbraten

Also gave things a quick test on one of my Linode accounts to ensure everything is still in order. And it was

@anbraten anbraten merged commit aa9a05a into woodpecker-ci:main Jan 28, 2024
3 checks passed
@woodpecker-bot woodpecker-bot mentioned this pull request Jan 28, 2024
1 task
@guisea guisea deleted the FEAT-linode-driver branch January 28, 2024 08:42

var metadata *linodego.InstanceMetadataOptions

// TODO: remove once linode user-data is out of beta

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still not available in all data centres. For me the closest is ap-southeast in Sydney. This region does not have metadata service

@woodpecker-bot
Copy link
Contributor

🎉 This PR is included in version 0.2.0 🎉

The release is now available here

Thank you for your contribution. ❤️📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Add new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants