Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
4562841b
Commit
4562841b
authored
Oct 08, 2018
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide a Docker image for building
parent
6d76f25b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
62 deletions
+53
-62
.circleci/config.yml
.circleci/config.yml
+1
-61
Dockerfile
Dockerfile
+32
-0
README.md
README.md
+18
-1
run_docker
run_docker
+2
-0
No files found.
.circleci/config.yml
View file @
4562841b
...
...
@@ -3,7 +3,7 @@ version: 2
defaults
:
&defaults
working_directory
:
~/repo
docker
:
-
image
:
circleci/python:3.7.0-stretch-browsers
-
image
:
registry.hub.docker.com/mdboom/pyodide:0.1.1
jobs
:
build
:
...
...
@@ -11,42 +11,9 @@ jobs:
steps
:
-
checkout
-
run
:
name
:
dependencies
command
:
|
# We need at least g++-8, but stretch comes with g++-6
# Set up the Debian testing repo, and then install g++ from there...
sudo bash -c "echo \"deb http://ftp.us.debian.org/debian testing main contrib non-free\" >> /etc/apt/sources.list"
sudo apt-get update
sudo apt-get install node-less cmake build-essential clang-format-6.0 uglifyjs chromium ccache
sudo apt-get install -t testing g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo update-alternatives --set gcc /usr/bin/gcc-8
sudo ln -s /usr/bin/clang-format-6.0 /usr/bin/clang-format
# Install Python dependencies
sudo pip install virtualenv
virtualenv pyodide-env
source pyodide-env/bin/activate
pip install pytest pytest-xdist pytest-instafail selenium PyYAML flake8
# Get recent version of Firefox and geckodriver
wget -O firefox.tar.bz2 https://download.mozilla.org/\?product\=firefox-latest-ssl\&os\=linux64\&lang\=en-US
tar jxf firefox.tar.bz2
wget https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz
tar zxf geckodriver-v0.21.0-linux64.tar.gz -C firefox
# Get recent version of chromedriver
wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
mv chromedriver pyodide-env/bin/
-
run
:
name
:
lint
command
:
|
source pyodide-env/bin/activate
make lint
-
restore_cache
:
...
...
@@ -57,7 +24,6 @@ jobs:
name
:
build
no_output_timeout
:
1200
command
:
|
source pyodide-env/bin/activate
ccache -z
make
ccache -s
...
...
@@ -76,9 +42,7 @@ jobs:
root
:
.
paths
:
-
./build
-
./pyodide-env
-
./cpython/build/3.7.0/host
-
./firefox
-
store_artifacts
:
path
:
/home/circleci/repo/build/
...
...
@@ -92,12 +56,6 @@ jobs:
-
run
:
name
:
test
command
:
|
# This Debian is so old, it doesn't know about wasm as a mime type, which then
# causes Firefox to complain when loading it. Let's just add the new mime type.
sudo bash -c "echo 'application/wasm wasm' >> /etc/mime.types"
source pyodide-env/bin/activate
export PATH=$PWD/firefox:$PATH
pytest test -v -k firefox
test-chrome
:
...
...
@@ -109,11 +67,6 @@ jobs:
-
run
:
name
:
test
command
:
|
# This Debian is so old, it doesn't know about wasm as a mime type, which then
# causes Firefox to complain when loading it. Let's just add the new mime type.
sudo bash -c "echo 'application/wasm wasm' >> /etc/mime.types"
source pyodide-env/bin/activate
pytest test -v -k chrome
benchmark
:
...
...
@@ -122,22 +75,9 @@ jobs:
-
checkout
-
attach_workspace
:
at
:
.
-
run
:
name
:
dependencies
command
:
|
sudo bash -c "echo \"deb http://ftp.us.debian.org/debian testing main contrib non-free\" >> /etc/apt/sources.list"
sudo apt-get update
sudo apt-get install -t testing g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo update-alternatives --set gcc /usr/bin/gcc-8
-
run
:
name
:
benchmark
command
:
|
sudo bash -c "echo 'application/wasm wasm' >> /etc/mime.types"
source pyodide-env/bin/activate
export PATH=$PWD/firefox:$PATH
python benchmark/benchmark.py cpython/build/3.7.0/host/bin/python3 build/benchmarks.json
-
store_artifacts
:
path
:
/home/circleci/repo/build/benchmarks.json
...
...
Dockerfile
0 → 100644
View file @
4562841b
FROM
circleci/python:3.7.0-stretch-browsers
# We need at least g++-8, but stretch comes with g++-6
# Set up the Debian testing repo, and then install g++ from there...
RUN
sudo
bash
-c
"echo
\"
deb http://ftp.us.debian.org/debian testing main contrib non-free
\"
>> /etc/apt/sources.list"
RUN
sudo
apt-get update
RUN
sudo
apt-get
install
node-less cmake build-essential clang-format-6.0 uglifyjs chromium ccache
RUN
sudo
apt-get
install
-t
testing g++-8
RUN
sudo
update-alternatives
--install
/usr/bin/gcc gcc /usr/bin/gcc-6 60
--slave
/usr/bin/g++ g++ /usr/bin/g++-6
RUN
sudo
update-alternatives
--install
/usr/bin/gcc gcc /usr/bin/gcc-8 80
--slave
/usr/bin/g++ g++ /usr/bin/g++-8
RUN
sudo
update-alternatives
--set
gcc /usr/bin/gcc-8
RUN
sudo
apt-get clean
RUN
sudo ln
-s
/usr/bin/clang-format-6.0 /usr/bin/clang-format
RUN
sudo
pip
install
pytest pytest-xdist pytest-instafail selenium PyYAML flake8
# Get recent version of Firefox and geckodriver
RUN
sudo
wget
--quiet
-O
firefox.tar.bz2 https://download.mozilla.org/
\?
product
\=
firefox-latest-ssl
\&
os
\=
linux64
\&
lang
\=
en-US
RUN
sudo tar
jxf firefox.tar.bz2
RUN
sudo rm
-f
/usr/local/bin/firefox
RUN
sudo ln
-s
$PWD
/firefox/firefox /usr/local/bin/firefox
RUN
sudo
wget
--quiet
https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz
RUN
sudo tar
zxf geckodriver-v0.21.0-linux64.tar.gz
-C
/usr/local/bin
# Get recent version of chromedriver
RUN
sudo
wget
--quiet
https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
RUN
sudo
unzip chromedriver_linux64.zip
RUN
sudo mv
$PWD
/chromedriver /usr/local/bin
RUN
sudo
bash
-c
"echo 'application/wasm wasm' >> /etc/mime.types"
WORKDIR
/src
README.md
View file @
4562841b
...
...
@@ -15,7 +15,8 @@ See [the demo](https://iodide.io/pyodide-demo/python.html)
# Building
These instructions were tested on Linux. OSX should be mostly the same.
Building is easiest on Linux. For other platforms, we recommend using
the Docker image (described below) to build Pyodide.
Make sure the prerequisites for
[
emsdk
](
https://github.com/juj/emsdk
)
are
installed. Pyodide will build a custom, patched version of emsdk, so there is no
...
...
@@ -33,6 +34,22 @@ Additional build prerequisites are:
`make`
## Using Docker
We provide a Debian-based Docker image on Docker Hub with the dependencies
already installed to make it easier to build Pyodide.
1.
Install Docker
2.
From a git checkout of Pyodide, run
`./run_docker`
3.
cd
`/src`
4.
Run
`make`
to build.
You can edit the files in your source checkout on your host machine, and then
repeatedly run
`make`
inside the Docker environment to test your changes.
# Testing
Install the following dependencies into the default Python installation:
...
...
run_docker
0 → 100755
View file @
4562841b
#!/bin/sh
docker run
-v
$PWD
:/src
--user
root
-e
NB_UID
=
$UID
-e
NB_GID+
$GID
-it
registry.hub.docker.com/mdboom/pyodide:0.1.1 /bin/bash
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment