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

Deployement of wheels and website: Remaing tasks #405

Closed
11 tasks done
jcfr opened this issue Jul 24, 2018 · 26 comments
Closed
11 tasks done

Deployement of wheels and website: Remaing tasks #405

jcfr opened this issue Jul 24, 2018 · 26 comments
Assignees
Milestone

Comments

@jcfr
Copy link
Collaborator

jcfr commented Jul 24, 2018

Remaining tasks are copied from #403:

Once this is integrated, we could:

  • enable flake8
  • automatic deployment of the website on merge to master
  • fix code and enable generation of wheels for python 3.7.
@jcfr jcfr self-assigned this Jul 24, 2018
@amueller
Copy link
Owner

alright, I'll try to do that today. Thanks so much for your help so far!

Btw, this is somewhat unrelated, but maybe interesting for scikit-ci: I also want to auto-build the docs and upload to github-pages and that's a common task that I don't think is very automated yet.

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 24, 2018

I also want to auto-build the docs and upload to github-pages and that's a common task that I don't think is very automated yet.

This will happen later tonight

Few options:

  • (1) add a simple script doc/deploy-gh-page.sh that would be called each time master is updated. Similar to this one. We will most likely add that script to scikit-ci-addons
    or
  • (2) add a travis step

@amueller
Copy link
Owner

Thanks. That doesn't have the sphinx build, though, right? That's an important part, and with sphinx-gallery (which is getting more and more popular) the build might take quite a while if there's examples to run. Which makes caching more important.

@amueller
Copy link
Owner

The solution you posted pushes the whole website every time, no matter the amount of changes, right? Or is the cloning part just not part of that comment? I'm not that familiar with worktree.

The scikit-learn website is 650mb. The wordcloud website is not as big, but if you want to put a solution into scikit-ci, I would favor a scalable one.

Doing just git clone on the repo will definitely not finish before CI timeout, --depth 1 is critical.

@amueller
Copy link
Owner

(and "of course" building the docs requires a whole different conda environment, and system package like texlive installed...)

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 24, 2018

That doesn't have the sphinx build, though, right?

The process to build the website would be the following:

cd doc
pip install -r requirements-doc.txt
make html
And finally publish the content of `_build/html` directory to gh-page using the worktree approach referenced above.

I suggest we move forward with such an approach. To support this, would it be possible to add the user @scikit-build-bot as a collaborator to the project with write access. We would then create a personal token with that bot user and use that to publish the site.

scalable approach to documentation site building and publishing

scikit-ci, I would favor a scalable one

Make sense. To address this, we usually decouple the documentation building by having a "service" listening a webhook associated with the repo. Based on the payload, a circleci build on a different project is triggered and will take care of updating the different website and also posting an update on the original PR or commit.

For reference, and for a different project, here are the building block allowing to have doxygen documentation automatically deployed when a master is updated, a release is created or a PR is pushed:

From the contributor, the following check is posted on the PR:

image

And when master is updated, similar build is also triggered:

image

@amueller
Copy link
Owner

wow that's pretty cool!

@amueller
Copy link
Owner

can we get that on scikit-learn? The doc build there works but you need a browser plugin to view it directly.

@amueller
Copy link
Owner

alright, tried to set the password and push a tag

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 24, 2018

alright, tried to set the password and push a tag

For the deployment step to work, the tag has to match the following regex:

filters:
tags:
only: /^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$/

I suggest to delete the test-tag, update the version and push something like 1.4.2. If everything looks on test.pypi.org, we can then remove the reference to --repository-url https://test.pypi.org/legacy/ and either delete and re-push the tag 1.4.2 or push 1.4.3.

Later, will also add How to make a release instruction

@amueller
Copy link
Owner

oh lol.
Do I need to create an account on test.pypi.org? My login from the main site doesn't seem to work and there doesn't seem to be a wordcloud package.

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 24, 2018

Do I need to create an account on test.pypi.org?

Yeap. And adding me as a maintainer too.

Look like there is a package now 😄 https://test.pypi.org/project/wordcloud/

On windows it failed because two tags were associated with the same commit and appveyor was confused. I just deleted the test-tag

On travis, it looks the secure variable are incorrect ...

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 24, 2018

On travis, it looks the secure variable are incorrect

I just added the env. variable directly in the travis setting and will remove them from the configuration file.

image

@amueller
Copy link
Owner

ah, sorry, didn't realize I had to change those as well...

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 24, 2018

I used mine and they should have work. Fixing things now

@amueller
Copy link
Owner

you're the maintainer on test.pypi.org btw ;)

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 24, 2018

Version bumped in aa54ef8

And has just been tag re-pushed. I expect the wheels to all be available on test.pypi.org .. if that looks good, I will remove reference to --repository-url https://test.pypi.org and re-push the tag.

Later tonight I should also have the website updated.

Then, we could do 1.5 instead ?

@amueller
Copy link
Owner

amueller commented Jul 24, 2018 via email

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 24, 2018

Travis wheel are now uploaded. Waiting for windows to show up.

That said, it look like there is a "random" error showing up on linux python 3.5 ... will see if I can reproduce locally

test_small_canvas 

wordcloud/wordcloud.py:431: in generate_from_frequencies
    / (sizes[0] + sizes[1]))
E   IndexError: list index out of range

During handling of the above exception, another exception occurred:
wordcloud/wordcloud.py:436: in generate_from_frequencies
    font_size = sizes[0]
E   IndexError: list index out of range

During handling of the above exception, another exception occurred:
test/test_wordcloud.py:324: in test_small_canvas
    WordCloud(max_words=50, width=20, height=20).generate(THIS)
wordcloud/wordcloud.py:605: in generate
    return self.generate_from_text(text)
wordcloud/wordcloud.py:587: in generate_from_text
    self.generate_from_frequencies(words)
wordcloud/wordcloud.py:439: in generate_from_frequencies
    "Couldn't find space to draw. Either the Canvas size"
E   ValueError: Couldn't find space to draw. Either the Canvas size is too small or too much of the image is masked out.

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 24, 2018

@amueller upload on Appveyor failed because you haven't verified your PyPi account on the test server. Assuming you used the same password as the production server, this shouldn't prevent from moving forward with the release.

HTTPError: 400 Client Error: User '*****' does not have a verified primary email address. Please add a verified primary email before attempting to upload to PyPI. See https://test.pypi.org/help/#verified-email for more 
information.for more information. for url: https://test.pypi.org/legacy

@amueller
Copy link
Owner

amueller commented Jul 24, 2018 via email

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 25, 2018

Closing. All sub-tasks have been completed.

@jcfr jcfr closed this as completed Jul 25, 2018
@amueller
Copy link
Owner

omg this is amazing! the website builds of master, not tags, right?

@jcfr
Copy link
Collaborator Author

jcfr commented Jul 25, 2018

the website builds of master, not tags, right?

yes

When is the website deployed ?

Each time a PR is done (or master updated), the website always build. This allows to know if something is broken during the generation process.

It is then only deployed when the branch is merged to master (or master updated)

deploy-master:
docker:
- image: circleci/python:3.7.0-stretch
steps:
- checkout
- attach_workspace:
at: ./
- run:
name: Deploy master
command: |
echo "Deploy master (not implemented)"
- run:
name: Deploy website
command: |
source_sha=$(cat doc/_build/html/.buildinfo | grep sha | cut -d: -f2)
repo_slug=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
doc/deploy-website.sh $repo_slug $source_sha --html-dir doc/_build/html

That said we could easily decide to:

  • deploy only when a tag is pushed

  • or deploy to a "preview website"

(also agreed .. this may be overkill for this particular project, this is just to show case what is possible ..)

@amueller
Copy link
Owner

no this is great and exactly what I want :)

@jcfr jcfr modified the milestone: 1.5.0 Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants