travis-racket icon indicating copy to clipboard operation
travis-racket copied to clipboard

Work with the travis docker infra

Open samth opened this issue 10 years ago • 24 comments

This requires:

  1. not using sudo
  2. not downloading for www.cs.utah.edu (see travis-ci/travis-ci#3012)

samth avatar Jan 12 '15 18:01 samth

  1. IME on Linux the Racket install.sh needs sudo (at least for the default target directories target option). But trying it just now, looks like the Travis env doesn't need sudo after all. So that's easy.
  2. Not sure what you mean for me to do instead? Get a nightly build from elsewhere, and if so, where? (BTW that URL is only used when people have HEAD as one of the Racket versions in their build matrix.)

greghendershott avatar Jan 12 '15 19:01 greghendershott

On 1, yes, you'd need to not install in /usr.

On 2, use the Northwestern snapshot server, http://plt.eecs.northwestern.edu/snapshots/

samth avatar Jan 12 '15 19:01 samth

Do you mean substituting http://plt.eecs.northwestern.edu/snapshots/current/installers/racket-test-current-x86_64-linux-precise.sh?

That would be easy enough to change. I have some vague recollection of someone (Matthew?) suggesting that Utah is more reliable source of nightly builds than Northwestern. Maybe I misremember.

(I understand that the container format apparently doesn't work with Utah, at all. So obviously Northwestern is more reliable than 0%. :) But how about the status quo, non-container Travis approach? It would be shame to make that less reliable, for the sake of getting the container-based approach working at all. Kind of two steps forward, one back? At least that's my question/concern.)

greghendershott avatar Jan 12 '15 19:01 greghendershott

On 1, yes, you'd need to not install in /usr.

Even simpler, actually it installed just fine to /usr without sudo, for me.

greghendershott avatar Jan 12 '15 19:01 greghendershott

That run didn't take place on the container infra, though, so I don't know if it works there.

samth avatar Jan 12 '15 19:01 samth

I don't think the Northwestern site is supposed to be less reliable -- they've been basically the same for me.

samth avatar Jan 12 '15 19:01 samth

That run didn't take place on the container infra, though, so I don't know if it works there.

Good point. I'll test by adding sudo: false to the .travis.yml.

By the way, do you think that (the container infra) should simply be the default in my example .travis.yml? I ask because your issue here today is the first I've heard about the container infra, and the Travis docs I've read so far are a bit terse about the pros and cons. Maybe a related question would be to ask, why are you excited about using the container infra?

greghendershott avatar Jan 12 '15 19:01 greghendershott

  • It allows caching of generated/download files
  • It seems to start sooner
  • It seems like it is inevitably the future of everything :)

I don't think you should make it the default, though.

samth avatar Jan 12 '15 19:01 samth

It seems like it is inevitably the future of everything :)

pavlov rings bell dog salivates interwebs say "docker" dev salivates

greghendershott avatar Jan 12 '15 19:01 greghendershott

So I made a mistake with my experiment. Fixing that, it turns out that sudo is indeed required for install to /usr in traditional Travis CI environment (which in hindsight makes sense).

So to avoid sudo, have to install elsewhere.

However people's existing .travis.yml files have lines like /usr/racket/bin/raco test. So changing the Racket install location will break those. So I need some backward compatability strategy. Which I can't figure out right now, so I'm going to have to set this aside at least for the very near future.

greghendershott avatar Jan 12 '15 20:01 greghendershott

Well, step 1 would probably be to configure the PATH in the script so that people don't have to hardcode paths.

In the current state, one option would be a command line option, and another would be a separate script.

samth avatar Jan 12 '15 21:01 samth

Yes but I'd tried that originally (when first setting this up 18 months ago) but I wasn't able to change PATH in install-racket.sh in a way that persisted for use back up in .travis.yml.

What definitely works is having the .travis.yml set an env var like RACKET_INSTALL_DIR that is used by the child install-racket.sh. That's why I'm experimenting with already on a topic branch.

(And if RACKET_INSTALL_DIR isn't set at all, then it must be an older .travis.yml, and we default it to /usr/racket and do use sudo. Otherwise we don't use sudo. Something like that.)

greghendershott avatar Jan 12 '15 22:01 greghendershott

So I went many rounds on this, partly due to my own dumb mistakes. Although I haven't yet merged it to master, here's where I ended up.

greghendershott avatar Jan 13 '15 00:01 greghendershott

What I didn't explore was caching specific directories. According to "things not to cache":

The cache's purpose is to make installing language-specific dependencies easy and fast, so everything related to tools like Bundler, pip, Composer, npm, Gradle, Maven, is what should go into the cache.

For other things, the cache won't be an improvement. Installing them usually takes only short amounts of time, but downloading them will be the same speed when pulled from the cache as it will be from their original source. You possibly won't see a speedup putting them into the cache.

I don't know what falls into this category, for all Racket projects, that I should put in the example .travis.yml? If you do please let me know.

But at least people should be able to set sudo: false in their .travis.yml (and install-racket.sh will support that), and also add a cache: directories: hash map for directories they know should be cached for their project. IIUC.

greghendershott avatar Jan 13 '15 04:01 greghendershott

I think the right thing to cache is usually ~/.racket/download-cache, as here.

samth avatar Jan 16 '15 23:01 samth

This issue got closed from a commit message, but since the example travis.yml doesn't talk about using cache: directories I'm reopening it.

greghendershott avatar Apr 03 '15 14:04 greghendershott

One thing I'm confused about, is how caching is supposed to work with the HEAD build target, which corresponds to the nightly snapshot builds.

In other words you probably do not want cache: directories when RACKET_VERSION = HEAD.

greghendershott avatar Apr 03 '15 14:04 greghendershott

Always grateful for improvements, but inasmuch as my question sort of led to reopening this issue, please don’t feel that you need to investigate on my account. travis-racket works great as is. Thank you for the work you’ve already done. Obviously, it was easy to point at mirror.racket-lang.org to avoid costing PLT bandwidth. Instead, my Travis builds will be paid for by students at Northeastern, who will experience slightly choppier video while streaming “Game of Thrones.”

mbutterick avatar Apr 03 '15 19:04 mbutterick

One other thing to cache here is the downloaded racket installers themselves for released versions, which would speed up some builds a lot.

samth avatar Aug 14 '15 22:08 samth

Probably this should be the default these days -- they seem to be discouraging the old infrastructure.

samth avatar Jan 10 '16 16:01 samth

Probably this should be the default these days -- they seem to be discouraging the old infrastructure.

I could uncomment this line.

Is that in your opinion sufficient? If not, could you submit a PR?

I don't have a lot of time to work on this, at the moment.

greghendershott avatar Jan 17 '16 15:01 greghendershott

Yeah, that seems sufficient.

samth avatar Jan 17 '16 15:01 samth

Yeah, that seems sufficient.

FWIW, I’ve had the sudo: false line uncommented in all my .travis.yml files for a while (for instance), and the Racket installers still get downloaded afresh for each build. I say this not to impose work on @greghendershott, but rather as a counterpoint to @samth’s theory.

mbutterick avatar Jan 22 '16 23:01 mbutterick

I stand corrected. I’ve been observing my Travis builds this weekend. The Racket installer “download” now takes only 7-10 secs for each build, which means the installers must be getting cached locally.

mbutterick avatar Jan 25 '16 03:01 mbutterick