Skip to content

ENH: Create DockerFile and devcontainer.json files to work with Docker and VS Code in Containers #30638

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

Merged
merged 12 commits into from
Jan 19, 2020

Conversation

yehoshuadimarsky
Copy link
Contributor

The instructions aren't that well written, and should probably be improved, but here's a first shot.

@gfyoung gfyoung requested a review from WillAyd January 3, 2020 18:51
@gfyoung gfyoung added Build Library building on various platforms Enhancement labels Jan 3, 2020
@gfyoung
Copy link
Member

gfyoung commented Jan 4, 2020

@WillAyd : Could you have a look?

@WillAyd
Copy link
Member

WillAyd commented Jan 4, 2020 via email


Instead of manually setting up a development environment, you can use Docker to
automatically create the environment with just several commands. Pandas provides a `DockerFile`
in the root directory to build a Docker image with a full pandas development environment.
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth linking the docker installation guide in this section

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where's that? I never saw a docker section.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Tried this out today in VS Code and I think looks good. Some minor comment otherwise @jreback for thoughts

Dockerfile Outdated
RUN mkdir "$pandas_home" \
&& git clone "https://github.com/$gh_username/pandas.git" "$pandas_home" \
&& cd "$pandas_home" \
&& git remote add upstream "https://github.com/pandas-dev/pandas.git"
Copy link
Member

Choose a reason for hiding this comment

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

Can you pull from upstream master after this step? Should keep up with the latest changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just did

Copy link
Member

Choose a reason for hiding this comment

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

Hmm don't see this in the diff. Should be a git pull upstream master in there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I thought you meant on my changes in the PR, lol, not in the DockerFile. got it

Copy link
Contributor

Choose a reason for hiding this comment

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

I think @WillAyd is requesting that the Dockerfile has a git pull upstream master?

Though I'm not sure that would achieve the desired effect, since it only happens when the docker image is built. How often does that happen? How does a person starting up a container ensure they're working with a fresh copy of pandas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest, the main use case is setting up a fresh env for some dev work, using this DockerFile and the devcontainer.json. Once you are using that env, if you use it for a while, it's up to the user to keep the code up to date with master. This is just intended for first time set up.

But the real value of this is that's it's dead simple to delete and create a new env in VS Online or with containers, so the usual use case is just to create a new env and not use an existing one for a while.

So I guess this line is indeed unnecessary, and I should remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if you agree before I revert that commit

Copy link
Member

@WillAyd WillAyd Jan 6, 2020

Choose a reason for hiding this comment

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

I think either this should stay or should remove the build step later. Doesn't make sense to build an outdated version for development

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure I follow you there. this is the same steps as the instructions in the main docs. Even if we remove git pull upstream master, how is this an outdated version? We just cloned the repo 2 lines before this, like 5 seconds ago

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

I think looks good to start. @pandas-dev/pandas-core any other thoughts?

@jbrockmendel
Copy link
Member

Two questions, neither blockers. Is the root directory the ideal/only place for this? Do we need to worry about this getting out of date?

@yehoshuadimarsky
Copy link
Contributor Author

yehoshuadimarsky commented Jan 9, 2020

@jbrockmendel per the VS Code docs devcontainer.json needs to be either in the root directory or in root/devcontainer. And regarding becoming outdated, the DockerFile is really very simple, just updating the Linux base image, cloning the pandas repo, and building it. Not sure what will be out of date.

@yehoshuadimarsky
Copy link
Contributor Author

yehoshuadimarsky commented Jan 19, 2020

Hi all, just bumping this in case it gets stale @pandas-dev/pandas-core can we merge?

Copy link
Member

@gfyoung gfyoung left a comment

Choose a reason for hiding this comment

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

@yehoshuadimarsky : Sorry for the radio silence! Let's merge and see how this goes.

Thank you for the patience and effort in putting this together! 🚀

@gfyoung gfyoung added this to the 1.1 milestone Jan 19, 2020
@gfyoung gfyoung merged commit 7d28040 into pandas-dev:master Jan 19, 2020
@yehoshuadimarsky yehoshuadimarsky deleted the vscode-env branch January 19, 2020 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Create a devcontainer.json env to work with VS Code in Containers
6 participants