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

Automate copying of signed binaries from dist.ipfs.io/go-ipfs #8316

Closed
Tracked by #8343
lidel opened this issue Jul 29, 2021 · 6 comments · Fixed by #8494
Closed
Tracked by #8343

Automate copying of signed binaries from dist.ipfs.io/go-ipfs #8316

lidel opened this issue Jul 29, 2021 · 6 comments · Fixed by #8494
Assignees
Labels
kind/maintenance Work required to avoid breaking changes or harm to project's status quo need/maintainer-input Needs input from the current maintainer(s)
Milestone

Comments

@lidel
Copy link
Member

lidel commented Jul 29, 2021

Current state

Proposed change

(iiuc) binaries attached to GitHub release are copied from /ipns/dist.ipfs.io/go-ipfs/ manually by @aschmahmann or @Stebalien – we should automate this.

Solution design

Create a GitHub Action workflow (triggered manually via workflow_dispatch and maybe daily via cron to avoid human error) that iterates over every vA.B.C release and attaches any missing files from /ipns/dist.ipfs.io/go-ipfs/VA.B.C (including manifest and .cid and .sha512 files) if not present yet.

This ensures that going forward https://github.com/ipfs/go-ipfs/releases is in sync with dist.ipfs.io.

@lidel lidel added kind/maintenance Work required to avoid breaking changes or harm to project's status quo need/maintainer-input Needs input from the current maintainer(s) labels Jul 29, 2021
@BigLep BigLep added this to the go-ipfs 0.11 milestone Sep 24, 2021
@BigLep
Copy link
Contributor

BigLep commented Sep 24, 2021

@schomatis : this is a good candidate that we could use your help for.

For testing/development, you can use your own repo for testing GitHub actions.

@schomatis
Copy link
Contributor

@BigLep I'm not familiar with GitHub actions nor with our distribution system so I'm not sure I'm the right person for this one. However, if you think it's worthwhile I can spend some time familiarizing myself with this and give it a try.

@BigLep
Copy link
Contributor

BigLep commented Sep 29, 2021

@schomatis : we talked about it more internally. The other go-ipfs Stewards will handle this.

@lidel lidel self-assigned this Sep 30, 2021
@petar
Copy link
Contributor

petar commented Oct 1, 2021

@lidel Could you provide a bit more detail on what needs to be done here?

@lidel
Copy link
Member Author

lidel commented Oct 4, 2021

For v0.10.0 we had to manually copy all files:

@petar I think MVP we want here is a Github Action workflow that utilizes https://github.com/actions/github-script to automate the copying if release files. We could run it once a day or trigger it manually.


Some notes / suggestions around implementation, hopefully you find them useful:

  • Use Github API to get the list of GitHub Releases (https://github.com/ipfs/go-ipfs/releases)
  • For every release version found via listReleases
    • calculate the size of assets array (number of files attached to Github Release)
    • count how many files got published at dist.ipfs.io
      • for example, ipfs ls /ipns/dist.ipfs.io/go-ipfs/v0.10.0 | wc -l returns 48 files
    • if release on GitHub has less than the directory on dist.ipfs, download and attach missing ones to it
      • ipfs get /ipns/dist.ipfs.io/go-ipfs/v0.10.0 will download everything to a directory named v0.10.0
      • then you can attach each file to Github Release via github.rest.repos.uploadReleaseAsset
        • sidenote: this is tricky to test without introducing garbage release. I think we could test this with 0.10.0 with minimal disruption: manually remove results file from the 0.10.0 release, and then observe is automation restores it back

lmk if you get blocked on anything, or think there is a better way for removing the need for manual copying of files on each release

@Stebalien
Copy link
Member

We could run it once a day or trigger it manually.

As long as it runs when sent a custom "event", we can trigger it from the https://github.com/ipfs/distributions actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/maintenance Work required to avoid breaking changes or harm to project's status quo need/maintainer-input Needs input from the current maintainer(s)
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants