Skip to content

Commit

Permalink
Remove custom docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Jul 5, 2022
1 parent 6eec821 commit 049772c
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 212 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ scripts/* linguist-documentation
tools/**/* linguist-documentation
cmake/** linguist-documentation
CMakeLists.txt linguist-documentation
docker/** linguist-documentation
**/*.sh linguist-documentation

* text=auto eol=lf
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,6 @@ jobs:
###############
- name: WebAssembly Test
run: yarn test_js --quiet --ci
env:
PSP_DOCKER: 1 # FIXME run in container directly

##########################################################################################################################
##########################################################################################################################
Expand Down
81 changes: 0 additions & 81 deletions docker/python/manylinux2010/Dockerfile

This file was deleted.

80 changes: 0 additions & 80 deletions docker/python/manylinux2014/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions docs/md/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,6 @@ yarn build

`perspective-python` supports Python 3.7 and upwards.

### Docker

[Docker](https://docs.docker.com/install/) images with pre-built development
environments are provided for the Python libraries.

To build Perspective using Docker, select the option in `yarn setup`.

---

## System-Specific Instructions
Expand Down
33 changes: 24 additions & 9 deletions scripts/_wheel_python.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ const {
const fs = require("fs-extra");
const IS_DOCKER = process.env.PSP_DOCKER;
const IS_MACOS = getarg("--macos");
const PYTHON = python_version();
let IMAGE = "manylinux2014";
let MANYLINUX_VERSION;
let PYTHON;

if (IS_DOCKER) {
MANYLINUX_VERSION = manylinux_version();
IMAGE = python_image(MANYLINUX_VERSION, PYTHON);
PYTHON = python_version(true);
IMAGE = python_image(MANYLINUX_VERSION, "xxx");
} else {
PYTHON = python_version();
}

/**
Expand Down Expand Up @@ -57,30 +60,42 @@ try {
// Create a wheel
if (MANYLINUX_VERSION) {
// install deps
const boost = [
`yum -y install wget`,
`wget https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.gz >/dev/null`,
`tar xfz boost_1_71_0.tar.gz`,
"cd boost_1_71_0",
`./bootstrap.sh`,
`./b2 -j8 --with-program_options --with-filesystem --with-system install`,
`cd ..`,
].join(" && ");

// This always runs in docker for now so install boost
cmd += ` ${boost} && `;

// These are system deps that may only be in place from pep-517/518 so
// lets reinstall them to be sure
cmd += `${PYTHON} -m pip install -U 'numpy>=1.13.1' wheel twine && `;
cmd += `${PYTHON} -m pip install -U 'numpy>=1.13.1' wheel twine auditwheel && `;

// remove the build folder so we completely rebuild (and pick up the
// libs we just installed above, since this build method won't use
// pep-517/518)
cmd += `rm -rf build/ &&`;
cmd += `rm -rf build/ && `;

// now build the wheel in place
cmd += `${PYTHON} setup.py build_ext bdist_wheel`;
cmd += `${PYTHON} setup.py build_ext bdist_wheel `;

// Use auditwheel on Linux - repaired wheels are in
// `python/perspective/wheelhouse`.
cmd += `&& ${PYTHON} -m auditwheel -v show ./dist/*.whl && ${PYTHON} -m auditwheel -v repair -L .lib ./dist/*.whl`;
cmd += `&& ${PYTHON} -m auditwheel -v show ./dist/*.whl && ${PYTHON} -m auditwheel -v repair -L .lib ./dist/*.whl `;
} else if (IS_MACOS) {
// Don't need to do any cleaning here since we will reuse the cmake
// cache and numpy paths from the pep-517/518 build in build_python.js
cmd += `${PYTHON} setup.py build_ext bdist_wheel`;
cmd += " && mkdir -p ./wheelhouse && cp -v ./dist/*.whl ./wheelhouse";
cmd += `${PYTHON} setup.py build_ext bdist_wheel `;
cmd += " && mkdir -p ./wheelhouse && cp -v ./dist/*.whl ./wheelhouse ";
} else {
// Windows
cmd += `${PYTHON} setup.py build_ext bdist_wheel`;
cmd += `${PYTHON} setup.py build_ext bdist_wheel `;
}

// TODO: MacOS wheel processed with delocate segfaults on
Expand Down
11 changes: 0 additions & 11 deletions scripts/install_tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@ try {
process.chdir("boost_1_71_0");
execute`./bootstrap.sh`;
execute`./b2 -j8 --with-program_options --with-filesystem --with-system install `;

console.log("-- Installing Flatbuffers");
execute`mkdir -p /usr/local`;
process.chdir("/usr/local");
execute`git clone --depth 1 --branch v1.12.1 https://github.com/google/flatbuffers.git`;
process.chdir("/usr/local/flatbuffers");
execute`cmake -G "Unix Makefiles"`;
execute`make`;
execute`cp -r /usr/local/flatbuffers/include/flatbuffers /usr/local/include`;
execute`ln -s /usr/local/flatbuffers/flatc /usr/local/bin/flatc`;
execute`chmod +x /usr/local/flatbuffers/flatc`;
}
} catch (e) {
console.log(e.message);
Expand Down
55 changes: 34 additions & 21 deletions scripts/script_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ const getarg = (exports.getarg = function (flag, ...args) {
* execute`${docker()} echo "Hello from Docker"`;
*/
exports.docker = function docker(image = "puppeteer") {
console.log(`-- Creating perspective/${image} docker image`);
console.log(`-- Creating quay.io/pypa/${image}_x86_64 docker image`);
const IS_WRITE = getarg("--write") || process.env.WRITE_TESTS;
const CPUS = parseInt(process.env.PSP_CPU_COUNT);
const PACKAGE = process.env.PACKAGE;
const CWD = process.cwd();
const IS_CI = getarg("--ci");
const IS_MANYLINUX = image.indexOf("manylinux") > -1 ? true : false;
const IMAGE = `perspective/${image}`;
const IMAGE = `quay.io/pypa/${image}_x86_64`;
let env_vars = bash`-eWRITE_TESTS=${IS_WRITE} \
-ePACKAGE="${PACKAGE}"`;
let flags = IS_CI ? bash`--rm` : bash`--rm -it`;
Expand All @@ -292,19 +292,38 @@ exports.docker = function docker(image = "puppeteer") {
*
* @returns {string} The python version to use
*/
exports.python_version = function python_version() {
if (process.env.PYTHON_VERSION) {
return `python${process.env.PYTHON_VERSION}`;
} else if (getarg("--python310")) {
return "python3.10";
} else if (getarg("--python39")) {
return "python3.9";
} else if (getarg("--python38")) {
return "python3.8";
} else if (getarg("--python37")) {
return "python3.7";
exports.python_version = function python_version(manylinux) {
if (manylinux) {
if (process.env.PYTHON_VERSION) {
const v = process.env.PYTHON_VERSION.replace(".", "");
return `/opt/python/cp${v}-cp${v}${
v === "37" || v === "36" ? "m" : ""
}/bin/python`;
} else if (getarg("--python310")) {
return `/opt/python/cp310-cp310/bin/python`;
} else if (getarg("--python39")) {
return `/opt/python/cp39-cp39/bin/python`;
} else if (getarg("--python38")) {
return `/opt/python/cp38-cp38/bin/python`;
} else if (getarg("--python37")) {
return `/opt/python/cp37-cp37m/bin/python`;
} else {
return `/opt/python/cp37-cp37m/bin/python`;
}
} else {
return "python3";
if (process.env.PYTHON_VERSION) {
return `python${process.env.PYTHON_VERSION}`;
} else if (getarg("--python310")) {
return "python3.10";
} else if (getarg("--python39")) {
return "python3.9";
} else if (getarg("--python38")) {
return "python3.8";
} else if (getarg("--python37")) {
return "python3.7";
} else {
return "python3";
}
}
};

Expand All @@ -319,13 +338,7 @@ exports.python_image = function python_image(image = "", python = "") {
console.log(
`-- Getting image for image: '${image}' and python: '${python}'`
);
if (python == "python2") {
if (image == "manylinux2014") {
throw "Python2 not supported for manylinux2014";
} else {
return "manylinux2010";
}
}

return `${image}`;
};

Expand Down

0 comments on commit 049772c

Please sign in to comment.