whywaita / shoes-aws

myshoes provider for Amazon Web Services
0 stars 1 forks source link

GH Workflow Labels are now passed into shoes-aws provider #2

Open alfred-stokespace opened 2 months ago

alfred-stokespace commented 2 months ago

This required a version bump of dependencies.

Also, added a minor nice-to-have feature of an AMI label prefix that gh workflow can use in order to customize the AMI per workflow if desired.

Testing:

  1. Local testing was completed successfully
  2. Integration testing was also performed and resulted in an instance being created in my account.

Of note:

  1. I added the one and only print statement for this module, let me know if you don't approve of that, I'll remove. Seemed useful if you also like the idea of dynamic ami label. Confirmed that log msg is visible from myshoes output.
  2. I found a bug in this reference impl for the UserData field. API docs state that it must be base64 and that was confirmed in integration testing.
whywaita commented 2 months ago

@alfred-stokespace Please rebase this Pull Request https://github.com/whywaita/shoes-aws/pull/3.

alfred-stokespace commented 2 months ago

@alfred-stokespace Please rebase this Pull Request #3.

tried to do this purely with git commands and ended up having git troubles...

git push -u origin patch-1
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 6 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 475 bytes | 475.00 KiB/s, done.
Total 5 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/alfred-stokespace/shoes-aws.git
 ! [remote rejected] patch-1 -> patch-1 (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/build.yaml` without `workflow` scope)
error: failed to push some refs to 'https://github.com/alfred-stokespace/shoes-aws.git'

Force push to my repo branch failed as well, odd. So I did fork sync on the website, which I think ended up performing a merge commit, I don't think that's what you wanted. Sorry.

alfred-stokespace commented 2 months ago

@whywaita I'm now far enough along in test that I see a problem back in the myshoes project that is blocking this from completely working...

https://github.com/whywaita/myshoes/blob/603c51b07c194f6d0e98218b65a5568ce8e3fc2c/pkg/starter/scripts.go#L79

Since that labels array is empty, it gets built into the compressed script with only ever two entries, myshoes and dependabot.

That has the downside of preventing the GH scheduler from scheduling the job to the runner.

I'm working on changes to the myshoes project so that labels from the job's json get pulled out and passed through a few functions to end up populating that labels array.

I see that in the script template you assume myshoes I'll make sure to filter out that label so it's not doubled up on.