Git Product home page Git Product logo

Comments (8)

MarcoGorelli avatar MarcoGorelli commented on May 21, 2024

Currently, the .travis.yml uses three Python images (3.5, 3.6, and 3.7). Should there be three different custom images, one for each of these versions of Python?

from alibi.

jklaise avatar jklaise commented on May 21, 2024

I think one could use a single image and manage the different Python versions for CI using virtualenv/conda. That being said, the CI docker image would probably be distinct from a docker image containing alibi to be used immediately (it would only include a python interpreter, alibi and all its dependencies), in which case it would make sense to have different versions. Were you thinking of the CI or the user facing image?

from alibi.

MarcoGorelli avatar MarcoGorelli commented on May 21, 2024

I was thinking of the CI (speeding up the

  - pip install -r requirements/requirements_all.txt
  - python -m spacy download en_core_web_md

part)

from alibi.

jklaise avatar jklaise commented on May 21, 2024

Yes, that would be the main reason for using a custom image (and we could use it for new builds and releases too). Were you interested in contributing a Dockerfile for this?

from alibi.

MarcoGorelli avatar MarcoGorelli commented on May 21, 2024

I'm interested in attempting this - yes. I was thinking that we could have a Dockerfile of this kind:

FROM python:3.7

COPY requirements/requirements_all.txt ./

RUN pip install -r requirements_all.txt
RUN python -m spacy download en_core_web_md

We could then build a Docker image, push it to DockerHub (e.g. as alibi/alibi-ci:latest), and then using this in the travis yml file as follows:

dist: xenial
language: python
image: alibi/alibi-ci:latest
before_install:
  - sudo apt-get install pandoc
script:
  - flake8 alibi
  - mypy alibi
  - travis_wait pytest
  - make build_pypi
  - make build_docs
after_success:
  - codecov

Before I run any of this, I just wanted to check how we would go about such a pull request.

  1. Is this what you had in mind? At present, I wouldn't know how to manage different Python versions with virtualenv/conda and just a single Docker image, but I can look into it.
  2. The travis file shouldn't reference a Docker image that's in my name, which is what would happen if I pushed the image. So, should the process be:
  • one pull request with new Dockerfile;
  • you build the Docker image, and push it to Docker hub, and let me know its tag
  • another pull request to update the travis file, referencing the new image
    ?

from alibi.

jklaise avatar jklaise commented on May 21, 2024

So, after having another look at Travis, if I understand correctly then custom build images are not supported out of the box... (travis-ci/travis-ci#7726). One could get around it by doing docker pull etc. in before_install and then making sure the tests run inside the image (and inside several virtualenvs separately), but I'm not sure if it's worth the hassle at this point.

from alibi.

MarcoGorelli avatar MarcoGorelli commented on May 21, 2024

I'm inclined to agree. Judging by the last successful travis build:

  • sudo apt-get install pandoc takes only 13 seconds
  • pip install -r requirements/requirements_all.txt takes about 2 minutes
  • python -m spacy download en_core_web_md takes 7 seconds.

By contrast, pytest takes almost 6 minutes! So, using a custom Docker image to speed up a 2-minute part of a 9-minute process might not be worthwhile.

I'll have a go at caching pip files instead

from alibi.

jklaise avatar jklaise commented on May 21, 2024

Closing as seems like the benefits would be minimal from the current setup.

from alibi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.