FLAMEGPU / FLAMEGPU2

FLAME GPU 2 is a GPU accelerated agent based modelling framework for CUDA C++ and Python
https://flamegpu.com
MIT License
106 stars 21 forks source link

Tag/Release Strategy using GitHub Actions #296

Closed ptheywood closed 3 years ago

ptheywood commented 4 years ago

Releases are tagged commits with extra information (prerelease?, description, extra zip files etc) which can then be used with predictable download locations (for zip download).

For FLAMEGPU 1, when we create a (minor?) release we also manually attach a zip file containing the compiled executables for windows, using the visual studio and CUDA versions within the vcxproj files, so users do not have to compile code to try FLAME GPU.

For FLAME GPU 2 we can continue and automate this tradition (through github actions). We could also attach artifacts containing python related parts, or the library + headers.

GitHub Actions can be triggered for both push.tag events and release events.

When a new tag is pushed to github the on.push.tags event is triggered (can be filtered by tag name). This includes new tags created by creating new releases from untagged commits through the github releases UI.

Release events are assocaited with a given tag, either pre-existing or newly created through the UI. There are 6 types of release events. Actions only occur for non-draft releases.

Release Proposal(s)

Option 1 - manual releases

New releases should always be created pre-release, and only marked as release once we are confident in the release (i.e. all tests + maybe manual tests).

Once we have GPU enabled actions (#97) we could automate/enforce the release/pre-release status.

There is an edge case where if the tag which a release points to is changed, it does not trigger a release event - The solution is to not change release tags. Alternatively it may be possibly to run an action on push.tag events, which checks for an existing release associated with that commt hash via the api.

We may also need to restrict the author of the tag (not sure how PRs from forks with tags work, but we don't want to do this for external tags without explicit support)

Option 2 - automatic releases based on tags.

On tag events trigger the more thorough CI / actual tests. If it passes, create a new release based on the tag, and attach relevant artefacts. This would likely need the thorough build to include multiple jobs for the respective OS's being tested:

A mechanism for getting the changelog for the description would be required.


I've made this separate to #290 as it's lower priority / longer-term.

ptheywood commented 3 years ago

Two main Release Workflow options.

  1. Tag-based.
  2. Manual Release based.

Versioning.

At this point, we need to decide on versioning (exactly).

Current plan is to use SemVer.

I.e. FLAME GPU2 MAJOR.MINOR.PATCH[-PRE.RELEASE.STUFF]

If we're planning to publish to pypi, we must follow PEP440, which supports SEMVER, but also supports date based schemes as the alternative (i.e. 2012.4).

Assuming we follow semver, we need to take a little care with the python version number re: pre-release builds.

Build Matrix

So, the options are:

General Release workflow:

  1. Create a pre-release version of some kind, then run some checks on it again / wait and see if things are happy.

Tag-based

  1. On push of a tag matching the pattern vX.Y.Z[-P]) perform a thorough build (above), storing relevant files as archive.
  2. Iff all these builds pass
    • create a release, autocomplete the message, attach artifacts. Mark as pre-release or release based on the tag number.
    • Push something to pypy. Maybe leave this as manual initially?

Pros:

Release-based

  1. Push tag to github
  2. Manually create a release via GitHub using that tag.
  3. Tag-based thorough build, so we know if the tag is OK prior to release creation.
  4. Publishing of the release triggers the thorough build. If it passes,

Alternatively, if the pushing of a tag to github is skipped and a new tag is created via the new release UI

  1. Create new release for a new tag based on the current head of the main branch vi UI
  2. Run thorough CI
  3. Attach artifacts and mutate the release body?

Pros:

Questions:

  1. What exact versioning scheme do we want to use.
    • Major.Minor.Patch[-Prerelease]
      • Start at 0. for semver implications
      • Start at 2. to minimise confusion
    • YYYY.MM.patch
  2. Binary Release Build Matrix
    • How many CUDA versions per binary release?
    • Visualisation? (possible, might be difficult)
    • Python - How large a matrix in general?
      • Still need to investigate the correct way to specify alternates. Initially a single release is probably OK? CUDA version might be very very important.
  3. Tag-based or Release Based actions / workflow.
    • Do we want to manually create releases from pushed tags, once thorough CI has already ran?

@mondus @Robadob @MILeach

Todo:

Associated Issues:

ptheywood commented 3 years ago

Personally, i'm in favour of:

  1. v2.MINOR.PATCH-PRERELEASE
    • I.e. Start with 2.0.0-alpha.
    • 2.0.0 as the first non-pre release when we've finalised the initial API.
    • 2.1.0-rc1 mark release candidates for testing (and potentially not upload them to pypy?)
  2. Matrix:
    • A single CUDA version per binary release seems fine to me, especially with recent CUDA's improvements in ABI stability (we just need to pick the correct version). We can change this later if needed.
    • Vis builds is probably worthwhile, if they work when extracted on random machines that may not be a perfect match. Might be an issue where dependencies are missing.
    • Initially keeping the python footprint small is probably simplest. Need to investigate more things really but it is time consuming.
  3. Thorough build on Tag push, plus Binary build on manual Release creation is my preference, but both should be fine.
Robadob commented 3 years ago
  1. What exact versioning scheme do we want to use. I agree that YYYY.MM.patch doesn't really make sense unless we want to commit to a regular release schedule (which I don't think we should). Less concerned about the 0 vs 2 thing.

  2. Binary Release Build Matrix

  1. Tag-based or Release Based actions / workflow.
ptheywood commented 3 years ago

Meeting decisons:

Will need install instructions on the docs, via wheel / zip download