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

Updated CircleCI configuration #116

Merged
merged 7 commits into from
Mar 3, 2020
Merged

Conversation

jbcurtin
Copy link
Contributor

@jbcurtin jbcurtin commented Sep 27, 2019

Updated the Circle CI Integration to compile each notebook individually before building all the pages. Failures are reported when the notebook cannot be built for some reason.

With this update, CircleCI was also update for spacetelescope/notebooks
Screen Shot 2019-09-26 at 11 44 43 AM
Screen Shot 2019-09-26 at 11 44 39 AM

Builds will only happen on master, every PR branch, and every forked PR branch

Here is a view of the CircleCI with reporting enabled
Screen Shot 2019-09-27 at 10 00 55 AM

Opened a new PR with better merge vector for commit history. ( Old PR: #115)

…r each notebook. Also added TestCase handling that'll report when errors are found with the pip install -r requirements.txt.
Copy link
Collaborator

@eteq eteq left a comment

Choose a reason for hiding this comment

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

I few inline comments, but here I'm leaving some bigger-picture ones mostly about where this code is exposed rather than the implementation itself (which looks pretty much good to me):

  • If I'm understanding right, this PR is now bypassing the convert.py file. This is problematic because the intent is that the user who wants to reproduce what's happening on circleci should be able to run convert.py and get the exact same thing. Moving that implementation to create_artifacts.py then makes it likely that the CircleCI and convert.py interfaces will diverge to the point that they are completely separate, which is likely to both confuse users and create a bigger maintainence burden. So is there perhaps a way to change create_artifacts.py to call the "standard" convert.py process (which can be changed in whatever way is necessary) while adding the artifact-storing as a second stage? Or alternatively, convert.py can be turned into a "command line interface" to what's in the other file (although see my next comment on that).
  • More broadly, some of this machinery is not really specific to CircleCI. That means it should go in nbpages itself rather than in the .circleci directory. A viable pathway might be to put this code somewhere temporarily (perhaps even in .circleci as it is right now) to prove that it works, and then port it over to nbpages as a follow-on PR (with a corresponding separate "remove it from this repo" PR)

if filename.endswith('.tar.gz'):
yield os.path.join(start_dir, filename)

for artifact_path in find_artifacts(ARTIFACT_DEST_DIR):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably the below should be an if __name__ == '__main__' block? Not critical, but might be useful for porting to nbpages (see general comment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or alternatively, make this a main function, and have an if __name__ == '__main__' that does command-line parsing.

xml.add_testsuite(test_suite)
xml.write(test_output_path)

# from nbpages import make_parser, run_parsed, make_html_index
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this left-over from a previous attempt, or is it intentional that there's a commented-out part here? (and if the latter, maybe add a comment above explaining why)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this logic was moved to make_pages.py; I failed to remove the comments; fixed

- webbpsf>=0.8
- scikit-learn

- astropy=3.0.4
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the shift to so many things in pip instead of conda? One of the intentions here is to make sure the astroconda-installed version works as intended... pip is meant for only if something is not in astroconda.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I think the answer is for performance. Possibly a good idea then, but I think this should be done as a separate independent PR because it has other consequences. So I'd say just don't make any changes to the environment beyond what might be needed to support the new CCI machinery, and move these changes to a separate PR

@jbcurtin
Copy link
Contributor Author

jbcurtin commented Dec 9, 2019

hey @eteq , I've updated the make_pages.py routine to call into convert.py. More errors are being generated, but the compilation process seems to still be working.

I'm okay with moving some of this machinery into nbpages, but I'm not sure how it could be used outside of the CircleCI Pipeline. Lets keep the scripts where they are right now, and in a few weeks if we see the need to move them into nbpages?

Copy link
Collaborator

@eteq eteq left a comment

Choose a reason for hiding this comment

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

(One minor inline suggestion, which is not a dealbreaker or anything if I mis-understood the intent)

@jbcurtin - ah, right - I meant we would port this circleci configuration into nbpages. Right now nbpages doesn't have "baked in" CI, but it would be useful to have it in the templates (e.g. https://github.com/eteq/nbpages/tree/cookiecutter_html).

Also, I think the artifact-building might also be useful to put in nbpages - while some of the details are circle-specific, the general idea there is useful for other CI and/or manual-pushing.

Regardless, I agree it makes sense to use this as a "testing ground" for now. Once we're convinced this works well here we could push it upstream.

.circleci/make_pages.py Outdated Show resolved Hide resolved
Co-Authored-By: Erik Tollerud <erik.tollerud@gmail.com>
@jbcurtin
Copy link
Contributor Author

hey @eteq , I've added your suggestion and the build succeeds. Will you merge the codes here?

@eteq eteq merged commit b1a86c1 into spacetelescope:master Mar 3, 2020
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