Skip to content

DEV: Add gitpod files #48107

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 13 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated docker files after local testing
  • Loading branch information
noatamir committed Nov 9, 2022
commit 7fe67e66f532c6530ccc36e861cf9d769e22a873
12 changes: 4 additions & 8 deletions gitpod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# Dockerfile for pandas development
# micromamba.Dockerfile for pandas development
#
# Usage:
# -------
#
# To make a local build of the container, from the 'Docker-dev' directory:
# docker build --rm -f "Dockerfile" -t <build-tag> "."
# docker build --rm -f "micromamba.Dockerfile" -t <build-tag> "."
#
# To use the container use the following command. It assumes that you are in
# the root folder of the pandas git repository, making it available as
Expand Down Expand Up @@ -38,7 +38,6 @@ ENV CONDA_DIR=/home/gitpod/mambaforge3 \
ENV PATH=${CONDA_DIR}/bin:$PATH \
WORKSPACE=/workspace/pandas


# -----------------------------------------------------------------------------
# ---- Creating as root - note: make sure to change to gitpod in the end ----
USER root
Expand Down Expand Up @@ -84,15 +83,12 @@ COPY ./gitpod/workspace_config /usr/local/bin/workspace_config
RUN chmod a+rx /usr/local/bin/workspace_config && \
workspace_config

# Copy conda environment file into the container - this needs to exists inside
# the container to create a conda environment from it
COPY environment.yml /tmp/environment.yml

# -----------------------------------------------------------------------------
# ---- Create conda environment ----
# Install pandas dependencies
RUN mamba env create -f /tmp/environment.yml
RUN conda activate ${CONDA_ENV} && \
# ---- Create conda environment ----
RUN conda activate $CONDA_ENV && \
mamba install ccache -y && \
# needed for docs rendering later on
python -m pip install --no-cache-dir sphinx-autobuild && \
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't be opposed to adding this to environment.yml

Expand Down
10 changes: 3 additions & 7 deletions gitpod/gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Doing a local shallow clone - keeps the container secure
# and much slimmer than using COPY directly or making a
# remote clone
ARG BASE_CONTAINER="pandas/pandas-dev:latest"
ARG BASE_CONTAINER="pythonpandas/pandas-dev:latest"
FROM gitpod/workspace-base:latest as clone

COPY --chown=gitpod . /tmp/pandas_repo

# the clone should be deep enough for versioneer to work
RUN git clone --shallow-since=2022-01-01 file:////tmp/pandas_repo /tmp/pandas
RUN git clone https://github.com/pandas-dev/pandas --depth 12 /tmp/pandas
Copy link
Member

Choose a reason for hiding this comment

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

Is depth of 12 then deep enough? Or will this still automatically fetch tags? (otherwise you can also explicitly fetch tags in a separate command)

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought it should be when we last chatted about this?!


# -----------------------------------------------------------------------------
# Using the pandas-dev Docker image as a base
Expand All @@ -24,7 +22,7 @@ USER root
ENV WORKSPACE=/workspace/pandas/ \
CONDA_ENV=pandas-dev

# Allows this Dockerfile to activate conda environments
# Allows this micromamba.Dockerfile to activate conda environments
SHELL ["/bin/bash", "--login", "-o", "pipefail", "-c"]

# Copy over the shallow clone
Expand All @@ -35,8 +33,6 @@ WORKDIR ${WORKSPACE}

# Build pandas to populate the cache used by ccache
RUN git config --global --add safe.directory /workspace/pandas
# chained RUN failed to activate. trying separate run commands
RUN git submodule update --init --depth=1 -- pandas/core/src/umath/svml
RUN conda activate ${CONDA_ENV} && \
python setup.py build_ext --inplace && \
ccache -s
Expand Down