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

store da-ghc-lib on a GCS bucket #209

Closed
wants to merge 1 commit into from

Conversation

garyverhaegen-da
Copy link
Contributor

At the moment, publishing a new version of da-ghc-lib (the one DAML depends on) is a manual process aimed at Bintray. As we have just received a note from JFrog that Bintray is sunsetting, this is a good opportunity to automate the deployment.

This PR aims at creating a GCS bucket (Terraform files to be applied manually) and change the CI process to push every master commit to said GCS bucket.

At the moment, publishing a new version of da-ghc-lib (the one DAML
depends on) is a manual process aimed at Bintray. As we have just
received a note from JFrog that Bintray is sunsetting, this is a good
opportunity to automate the deployment.

This PR aims at creating a GCS bucket (Terraform files to be applied
manually) and change the CI process to push every master commit to said
GCS bucket.
@garyverhaegen-da garyverhaegen-da force-pushed the store-da-ghc-lib-on-bucket branch from b3c4eab to d6ce2ec Compare May 20, 2020 10:46
@garyverhaegen-da
Copy link
Contributor Author

Note: as of opening this PR, there are a number of missing pieces:

  • I will need some help to complete the build/upload process. I have left ??? markers where I think I need help, but feel free to correct anything else too.
  • I have not yet applied the Terraform files (waiting for @hurryabit's approval for that), so the bucket doesn't exist yet. This in turn means the CI writer credentials don't exist yet either and are therefore not yet added to Azure.

Additional notes:

  • The azure-pipelines.yml file was written from the perspective of a single job; I had to add a separate job, which means indenting all of the existing content. The diff on this PR is therefore better viewed without whitespace diffs.
  • We do not have a process for tracking infra changes from this repo for future audits. I expect this to be a one-off, so my plan for now is to create a corresponding Standard-Change PR on the daml repo (with an empty commit and a link to this PR) so it will appear in our monthly report. Please advise if this doesn't seem right.

@garyverhaegen-da
Copy link
Contributor Author

Oh and also as usual once this is all done and applied and merged we'll still need Ed to create the DNS entry before the bucket is actually useable.

Copy link
Contributor

@shayne-fletcher shayne-fletcher left a comment

Choose a reason for hiding this comment

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

One small thing found and noted inline that looks wrong (wrong ghc-flavor).

Some general notes:

  • I'm a little unclear on how the new strategy is intended to work;
  • If it's an automated build/upload on push then ghc-lib isn't the right repo to be watching, it's commits to the da-master-8.8.1 branch of git@github.com:digital-asset/ghc.git that should trigger uploads;
  • Not sure about the calculation of VERSION_TAG - will it match what CI.hs generates for the tarball name(s)? What happens if you find yourself needing to do a second one on the same day? e.g. ghc-lib-8.10.1.20200518.1.tar.gz
  • There are two tarballs produced during the build ghc-lib-parser and ghc-lib - that does seem accounted for
  • The code in ghc-lib/CI.hs needs updating to remove/replace the bintray bits and that's not here (yet).


VERSION_TAG="$(git log -n1 --format=%cd --date=format:%Y%m%d HEAD).$(git rev-list --count HEAD).$(git log -n1 --format=%h --abbrev=8 HEAD)"

stack runhaskell --package extra --package optparse-applicative CI.hs -- --ghc-flavor=ghc-8.8.1
Copy link
Contributor

Choose a reason for hiding this comment

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

The flavor for DA is da-ghc-8.8.1.

@shayne-fletcher
Copy link
Contributor

  • Not sure about the calculation of VERSION_TAG - will it match what CI.hs generates for the tarball name(s)? What happens if you find yourself needing to do a second one on the same day? e.g. ghc-lib-8.10.1.20200518.1.tar.gz

Could be a small enhancement to CI.hs might help here (maybe, maybe not). I've implemented a --version-tag option in ghc-lib-parser-ex that looks like it might be of use here in that we could use that feature to "inject" the desired version name into the build process from the script exogenously.

@garyverhaegen-da
Copy link
Contributor Author

This is the wrong repo for this, and probably the wrong approach. Thanks @shayne-fletcher for all the additional context; closing this for now.

@garyverhaegen-da garyverhaegen-da deleted the store-da-ghc-lib-on-bucket branch May 20, 2020 12:12
@cocreature
Copy link
Contributor

I’m not sure this is necessarily the wrong repo. It depends on both. Right now, there is no CI on the ghc repo at all so adding it here seems like a reasonable option. We could just have a single file that locks down the revision and if that changes we publish.

@shayne-fletcher
Copy link
Contributor

I’m not sure this is necessarily the wrong repo. It depends on both. Right now, there is no CI on the ghc repo at all so adding it here seems like a reasonable option. We could just have a single file that locks down the revision and if that changes we publish.

Indeed. Gary and I ended up discussing that scheme and it may well be what gets done. He's mulling it over.

@garyverhaegen-da
Copy link
Contributor Author

For anyone stumbling on this in the future and finding the suspense unbearable, this has been implemented across both this and the daml repo as digital-asset/daml#6188 and #215.

@shayne-fletcher
Copy link
Contributor

Thanks @garyverhaegen-da !

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.

3 participants