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

move Rust and Go SDKs to their own repos #2289

Merged
merged 5 commits into from
Feb 21, 2024
Merged

Conversation

dicej
Copy link
Contributor

@dicej dicej commented Feb 21, 2024

These SDKs and their examples have moved to
https://github.com/fermyon/spin-rust-sdk and
https://github.com/fermyon/spin-go-sdk, respectively. The plan is to begin releasing them on their own cadence, independent of Spin releases. This will allow us to make breaking changes in semver-compatible major releases without tying such releases to a Spin major release, e.g. to target WASI 0.2.0.

Note that I've update the integration tests which use the Rust SDK to use the latest stable release (2.2.0) instead of a path-based dependency. Alternatively, we could point it at the main branch of the spin-rust-sdk Git repo, but that will require close coordination once we start making breaking changes to the API in that repo.

We may also want to move the Rust and Go templates to the new repos at some point. I've left them where they are for the time being.

Finally, I've removed the SDK-specific bits from release-process.md and the GitHub workflows. We'll need to move those things to their respective SDK repos. Reproducing the automated Go SDK tagging that feeds into the templates may require moving at least the Go templates as noted above.

These SDKs and their examples have moved to
https://github.com/fermyon/spin-rust-sdk and
https://github.com/fermyon/spin-go-sdk, respectively.  The plan is to begin
releasing them on their own cadence, independent of Spin releases.  This will
allow us to make breaking changes in semver-compatible major releases without
tying such releases to a Spin major release, e.g. to target WASI 0.2.0.

Note that I've update the integration tests which use the Rust SDK to use the
latest stable release (2.2.0) instead of a path-based dependency.
Alternatively, we could point it at the `main` branch of the `spin-rust-sdk` Git
repo, but that will require close coordination once we start making breaking
changes to the API in that repo.

We may also want to move the Rust and Go templates to the new repos at some
point.  I've left them where they are for the time being.

Finally, I've removed the SDK-specific bits from release-process.md and the
GitHub workflows.  We'll need to move those things to their respective SDK
repos.  Reproducing the automated Go SDK tagging that feeds into the templates
may require moving at least the Go templates as noted above.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
You can also find many more examples in the SDK repositories for various
languages, including:

- [Rust](https://github.com/fermyon/spin-rust-sdk/tree/main/examples)
Copy link
Collaborator

Choose a reason for hiding this comment

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

One constant point of contention:

If there's differences between the version of the SDK on main and the one latest stable release, people tend to get confused. We probably don't want to point to a versioned branch from here as that will quickly become stale, but we may somehow want to indicate in the README of the SDK repos how to find examples for the latest stable version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps we could create a stable branch in each of the SDK repos which always points to the latest stable release tag, and make updating it part of the release process for each SDK. Then we could link to those branches from here.

signoff: true

# This will run when the PR above is approved and merged into main via a merge commit
push-templates-tag:
Copy link
Contributor

@vdice vdice Feb 21, 2024

Choose a reason for hiding this comment

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

Double-checking with @itowlson on the subject of templates:

For go, Assuming the v3 version of the sdk in its new home is a ways out and there may be a handful of subsequent Spin releases (eg 2.3, 2.4, etc) before it is ready, do we need to do anything ensure templates function as expected? For as long as the go templates are in this repo and no new templates tags are pushed, will future spin clients just get the last, most recent templates (2.2) for this interim period?

The rust templates meanwhile should be ready to move to their new sdk home, right? Would we update the spin templates cli commands to add the new sdk repo as a default to fetch from?

(Or maybe the go templates are also ready to migrate to their new sdk home as well -- especially if spin clients just fetch the 2.2-tagged templates near-term?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

If template tags are not updated, then post-2.2 Spin releases will fall forward to the templates on main.

Moving the templates has implications for the installer, docs, and spin new. I am wary of moving those without careful coordination.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, let's assume we won't move the templates for the foreseeable future. In that case, I guess our release process could look something like this:

  • SDKs are released on their own schedule; for example, let's say we release spin-rust-sdk 3.0.0 tomorrow
  • Templates remain tied to Spin releases, so they are not updated until the next Spin release; e.g. Spin 2.3 would be our first opportunity to update the Rust templates to use spin-rust-sdk 3.0.0 (although I guess we could update them in main sooner than that)
    • i.e. when we make a Spin release, we tag the templates as usual, and those templates will point to whatever the latest stable versions of the SDKs happen to be

Does that sound right? (No strong opinions here -- just trying to form a plan of some kind)

Copy link
Collaborator

Choose a reason for hiding this comment

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

We have to tag templates at minimum when we do a (non-patch) Spin release.

We can optionally update the templates and move the tags when we do a SDK release, even if no Spin release is planned. But that's not part of the Spin release process and can be ad-hocked in if we ever feel the urge to actually do it.

Copy link
Contributor

@vdice vdice Feb 21, 2024

Choose a reason for hiding this comment

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

i.e. when we make a Spin release, we tag the templates as usual, and those templates will point to whatever the latest stable versions of the SDKs happen to be

That sounds reasonable to me. So, we'd re-introduce the corresponding automation around pushing the templates tag (eg spin/templates/v2.3) on a Spin release for the near-term? edit: as @itowlson says above, didn't yet see that comment when I posted this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Er, maybe just keep push-templates-tag and remove create-template-sdk-update-pr, since we don't want to update SDK versions automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

e.g.:

  push-templates-tag:
    runs-on: ubuntu-latest
    needs: build-and-sign
    if: startsWith(github.ref, 'refs/tags/v')
    steps:
      - uses: actions/checkout@v3

      - name: Set the tag to spin/templates/v*
        shell: bash
        run: |
          spin_tag=$(echo "${{ github.ref }}" | grep -Eo "refs/tags/v[0-9.]+")
          IFS=. read -r major minor patch <<< "${spin_tag}"
          echo "TEMPLATE_TAG=spin/templates/$major.$minor" >> $GITHUB_ENV

      - name: Tag spin/templates/v* and push it
        shell: bash
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          git tag ${{ env.TEMPLATE_TAG }} -f
          git push origin ${{ env.TEMPLATE_TAG }} -f

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe I've addressed this in 65ed372, but not sure how to test it. Maybe push a release tag to my fork?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that should be it... thanks for testing!

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
We'll update the `stable` branch of the applicable repo each time we make a new
stable release of any of the SDKs so that these links always point to the
examples for the latest stable release rather than `main`.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej marked this pull request as ready for review February 21, 2024 18:41
Unlike the original version, this one does not depend on the Go SDK automation
and instead derives the template tag name from the Spin version tag name.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
This ensures that we don't tag a broken build.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej merged commit 78f84e7 into spinframework:main Feb 21, 2024
10 checks passed
@dicej dicej deleted the move-sdks branch February 21, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants