Skip to content

chore(build): upload dart artifacts to GCS#2952

Closed
alexeagle wants to merge 1 commit into
angular:masterfrom
alexeagle:deploy_dart
Closed

chore(build): upload dart artifacts to GCS#2952
alexeagle wants to merge 1 commit into
angular:masterfrom
alexeagle:deploy_dart

Conversation

@alexeagle
Copy link
Copy Markdown
Contributor

second attempt after rollback of #2946

After each successful build in the dart stable variant, this uploads just enough of the dart
artifacts to mirror what we would push to pub.
By uploading the files instead of a zip, this lets dart users depend on an unreleased snapshot
of angular2, and lets us easily fetch the dart artifacts for sync into google3
without having to re-build (potentially in a subtly different environment).
This doesn't upload anything for pull requests.

NOTE: this time I've scaled this back and tested properly. https://travis-ci.org/alexeagle/angular/jobs/70157553 uploaded its result to https://console.developers.google.com/project/resonant-tower-260/storage/browser/angular2-snapshots/e3c6f83df9ad0ee621d6bb1c81df63a4c277cbb5/

@alexeagle alexeagle added comp: build/pipeline action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 9, 2015
Comment thread .travis.yml Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add dist/dart/angular2_material,dist/dart/angular2_benchmarks, dist/dart/benchpress to match the modules we publish to pub (see https://pub.dartlang.org/search?q=angular2)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

wow the docs are really slim. Managed to track down to here
https://github.com/travis-ci/dpl/blob/4c8fd4f6084174da11ee1962e004ba4951f1f14b/lib/dpl/provider/gcs.rb#L31
that we can only give one local_dir, so I'm testing it with dist/dart to be sure it won't time out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It works but adds three more mins to the build (35m instead of 32m)
The timeout is 10m so this will work, but should we consider uploading an archive file instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also in the getting started guide they say
"If you plan on putting more than a few thousand objects into a bucket, then you should probably keep a list of them somewhere with an index, such as AppEngine datastore or bigtable, because asking for a bucket listing containing millions of objects can take a long time."

That makes me concerned that directory listing will get slower over time. In addition, when we add the JS side, I think we'll have no choice but to create and upload an archive file (eg. ZIP) so it will be different from Dart.

All that said, my inclination is to go ahead with this change, but let's discuss one more time. It would also be easy to make a dist/upload folder in gulp where we write an archive of whatever should be uploaded for the snapshot builds.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, sounds like gzip-ing the artifacts is the way to go.

Btw, we do a small amount of clean-up, from the sources in dist/dart before we push to pub (hence the copying over to dist/pub) https://github.com/angular/angular/blob/master/scripts/publish/pub_publish.sh#L34.

How about just changing the tasks that create our three final artifacts - dist/npm, dist/pub and dist/bundle, to put wrap them all in upload as dist/upload/npm, dist/upload/pub, etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But we don't currently run those tasks on Travis, so we don't have them,
right? Would you want to start running pub_publish.sh on travis? It seems
to me that any steps we do when pushing a release don't need to be present
on snapshots.
The dist.tgz was easy, testing it now. I still like the fidelity of
uploading the same structure you'd get from running the build locally.

On Thu, Jul 9, 2015 at 10:40 AM Rado Kirov notifications@github.com wrote:

In .travis.yml
#2952 (comment):

    • provider: gcs
  • This is for project angular-github-babysitter

  • access_key_id: GOOGIOQTDBEOPBUAWFZQ
  • secret_access_key:
  •  secure: "MEDggllZ5fw4wI9CEUi8WR6jKsKXqdRF/DLxSNC2JpzM5RlVeBm0uqjntYT1Cf1dASvQ2/+vZCUikL/3A48NcoEYRHXGmxu8D6t/SvleQD8Xv434xFOdsa2QqP/HiCtqCLOI5jJz1JVoB5nNyKKZ33ogTUL1LV1TfcrAioyizW8="
    
  • this bucket has a lifecycle to delete after 1 year:

  • $ echo '{"rule": [{"action": {"type": "Delete"}, "condition": {"age": 365}}]}' > lifecycle.json

  • $ gsutil lifecycle set lifecycle.json gs://angular2-snapshots

  • bucket: angular2-snapshots
  • don't delete generated files

  • skip_cleanup: true
  • serve to public at https://storage.googleapis.com/angular2-snapshots/SHA/dart_stable/path/to.file

  • acl: public-read
  • Upload just enough files to mirror pub.

  • Be careful how many files are uploaded. 10k files makes the build time out. 1k seems to work.

  • local-dir: dist/dart/angular2

Yes, sounds like gzip-ing the artifacts is the way to go.

Btw, we do a small amount of clean-up, from the sources in dist/dart
before we push to pub (hence the copying over to dist/pub)
https://github.com/angular/angular/blob/master/scripts/publish/pub_publish.sh#L34
.

How about just changing the tasks that create our three final artifacts -
dist/npm, dist/pub and dist/bundle, to put wrap them all in upload as
dist/upload/npm, dist/upload/pub, etc.


Reply to this email directly or view it on GitHub
https://github.com/angular/angular/pull/2952/files#r34281590.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Without running scripts/publish/pubspec_cleaner.js the dist/dart is invalid and cannot be synced with Google either. I had to add dry_run option to pub_publish so I can run the modification without publishing for the sync script.

But if we reduce npm_publish and pub_publish to a simple copy, the dist.zip will be enough as it is. That would require moving pubspec_cleaner.js to build.dart which is not crazy.

second attempt after rollback of angular#2946

After each successful build in the dart stable variant, this uploads just enough of the dart
artifacts to mirror what we would push to pub.
By uploading the files instead of a zip, this lets dart users depend on an unreleased snapshot
of angular2, and lets us easily fetch the dart artifacts for sync into google3
without having to re-build (potentially in a subtly different environment).
This doesn't upload anything for pull requests.
@alexeagle
Copy link
Copy Markdown
Contributor Author

okay, ready to merge, LG?

@rkirov
Copy link
Copy Markdown
Contributor

rkirov commented Jul 9, 2015

LGTM.

@alexeagle
Copy link
Copy Markdown
Contributor Author

Merged in fe49a7f

@alexeagle alexeagle closed this Jul 9, 2015
@alexeagle alexeagle deleted the deploy_dart branch July 9, 2015 19:59
@alexeagle
Copy link
Copy Markdown
Contributor Author

Filed #2969 to followup on the
pubspec_cleaner, but as discussed in person it's not a blocker for google3
sync.

On Thu, Jul 9, 2015 at 12:58 PM Rado Kirov notifications@github.com wrote:

LGTM.


Reply to this email directly or view it on GitHub
#2952 (comment).

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants