Skip to content

Commit 0d23a38

Browse files
committed
reinitializing commit to accomodate large files
0 parents  commit 0d23a38

38 files changed

+4176
-0
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

.gitattributes

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
data/biodiversity filter=lfs diff=lfs merge=lfs -text
2+
data/bowling-green.american-assembly filter=lfs diff=lfs merge=lfs -text
3+
data/local filter=lfs diff=lfs merge=lfs -text
4+
data/vtaiwan-uber-conv.ts-2015-08-28.exported-2020-07-02 filter=lfs diff=lfs merge=lfs -text
5+
data/biodiversity/comments.csv filter=lfs diff=lfs merge=lfs -text
6+
data/vtaiwan-uber-conv.ts-2015-08-28.exported-2020-07-02/comments.csv filter=lfs diff=lfs merge=lfs -text
7+
data/vtaiwan-uber-conv.ts-2015-08-28.exported-2020-07-02/participants-votes.csv filter=lfs diff=lfs merge=lfs -text
8+
data/vtaiwan-uber-conv.ts-2015-08-28.exported-2020-07-02/stats-history.csv filter=lfs diff=lfs merge=lfs -text
9+
data/bowling-green.american-assembly/stats-history.csv filter=lfs diff=lfs merge=lfs -text
10+
data/bowling-green.american-assembly/votes.csv filter=lfs diff=lfs merge=lfs -text
11+
data/vtaiwan-uber-conv.ts-2015-08-28.exported-2020-07-02/summary.csv filter=lfs diff=lfs merge=lfs -text
12+
data/biodiversity/summary.csv filter=lfs diff=lfs merge=lfs -text
13+
data/biodiversity/participants-votes.csv filter=lfs diff=lfs merge=lfs -text
14+
data/biodiversity/stats-history.csv filter=lfs diff=lfs merge=lfs -text
15+
data/biodiversity/votes.csv filter=lfs diff=lfs merge=lfs -text
16+
data/bowling-green.american-assembly/comments.csv filter=lfs diff=lfs merge=lfs -text
17+
data/bowling-green.american-assembly/participants-votes.csv filter=lfs diff=lfs merge=lfs -text
18+
data/bowling-green.american-assembly/summary.csv filter=lfs diff=lfs merge=lfs -text
19+
data/vtaiwan-uber-conv.ts-2015-08-28.exported-2020-07-02/votes.csv filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
target
2+
.ipynb_checkpoints
3+
notebooks/jupyter/.ipynb_checkpoints
4+
data/local
5+
notebooks/oz/local/
6+
notebooks/jupyter/local
7+
notebooks/build/local
8+
clojupyter-standalone.jar

.nrepl.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:bind "0.0.0.0" :port 3850}

Dockerfile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
FROM clojure:openjdk-11-tools-deps
2+
3+
EXPOSE 3850
4+
EXPOSE 3860
5+
EXPOSE 3870
6+
EXPOSE 3880
7+
8+
9+
RUN echo "deb http://fr.archive.ubuntu.com/ubuntu bionic main" >> /etc/apt/sources.list &&\
10+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 &&\
11+
apt-get update &&\
12+
apt-get install libpython3.6-dev python3-pip -y --allow-unauthenticated
13+
14+
# This should make tech.ml stuff fast for things like pca/svd
15+
RUN apt-get install -y libblas-dev
16+
17+
# Preinstall these packages, so later requirements.txt install will be faster
18+
RUN pip3 install seaborn &&\
19+
pip3 install matplotlib &&\
20+
pip3 install sklearn &&\
21+
pip3 install numpy &&\
22+
pip3 install umap-learn &&\
23+
pip3 install trimap &&\
24+
pip3 install altair &&\
25+
pip3 install jupyter
26+
27+
RUN clojure -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0"} \
28+
techascent/tech.ml.dataset {:mvn/version "3.01" \
29+
:exclusions [org.slf4j/slf4j-api]} \
30+
semantic-csv {:mvn/version "0.2.1-alpha1"} \
31+
net.mikera/core.matrix {:mvn/version "0.62.0"} \
32+
clj-python/libpython-clj {:mvn/version "1.45"} \
33+
org.clojure/tools.deps.alpha {:mvn/version "0.6.496" \
34+
:exclusions [org.slf4j/slf4j-nop]} \
35+
cider/cider-nrepl {:mvn/version "0.21.1"} \
36+
metasoarous/oz {:mvn/version "1.6.0-alpha11"} \
37+
clojupyter {:mvn/version "0.3.2"}}}' \
38+
-e "(clojure.core/println :deps-downloaded)"
39+
40+
41+
# Installing node
42+
ENV NODE_VERSION=14.5.0
43+
RUN apt-get install -y curl
44+
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
45+
ENV NVM_DIR=/root/.nvm
46+
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
47+
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
48+
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
49+
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
50+
RUN node --version
51+
RUN npm --version
52+
53+
54+
# Install vega-cli for exporting
55+
RUN apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev g++
56+
RUN apt-get install -y zlibc zlib1g-dev zlib1g
57+
58+
RUN npm install -g node-gyp
59+
RUN npm install -g --unsafe-perm canvas
60+
RUN npm install -g --unsafe-perm vega vega-lite vega-cli
61+
62+
# Pandoc for fun and profit
63+
RUN apt-get -y install pandoc
64+
65+
66+
# Everything after this will get rerun even if the commands haven't changed, since data could change
67+
WORKDIR /app
68+
COPY . .
69+
70+
# Make sure deps are pre-installed
71+
RUN pip3 install -r requirements.txt
72+
RUN clojure -e "(clojure.core/println :deps-downloaded)"
73+
74+
# Build a uberjar target for clojupyter kernel
75+
RUN clojure -Spom
76+
RUN clojure -A:depstar -m hf.depstar.uberjar clojupyter-standalone.jar -C -m polis.main
77+
RUN clojure -m clojupyter.cmdline install --ident polis-clojupyter-kernel --jarfile clojupyter-standalone.jar
78+
79+
80+
# Systems go
81+
CMD bin/run.sh
82+
83+

Makefile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Makefile adapted from
2+
# from https://tech.davis-hansson.com/p/make/
3+
4+
# Use bash as the shell
5+
SHELL := bash
6+
# Exit on any shell error
7+
.SHELLFLAGS := -eu -o pipefail -c
8+
# Delete target file if script fails
9+
.DELETE_ON_ERROR:
10+
# Warn when a Make variable is not defined
11+
MAKEFLAGS += --warn-undefined-variables
12+
# Do not use standard rules for C builds
13+
MAKEFLAGS += --no-builtin-rules
14+
15+
# No default target
16+
.PHONY: all
17+
all:
18+
19+
20+
# Working tree state:
21+
ALLOW_DIRTY=false
22+
23+
.PHONY: dirty
24+
dirty:
25+
$(eval ALLOW_DIRTY=true)
26+
@echo "WARNING: Deploys will be allowed from a dirty working tree."
27+
28+
29+
# Make sure there aren't uncommitted changes
30+
.PHONY: check-clean-tree
31+
check-clean-tree:
32+
@if [[ "$(ALLOW_DIRTY)" != "true" && -n "$$(git status --porcelain)" ]]; then \
33+
echo "ERROR: Working directory not clean."; \
34+
exit 97; \
35+
fi
36+
37+
38+
.PHONY: build
39+
build:
40+
docker build . -f Dockerfile -t polis-analysis-docker
41+
42+
43+
.PHONY: clean
44+
clean:
45+
ifeq ($(strip $(shell docker ps -aq)),)
46+
echo "No running processes"
47+
else
48+
docker rm -fv $(shell docker ps -aq)
49+
endif
50+
51+
nrepl_port ?=3850
52+
oz_port ?=3860
53+
jupyter_port ?=3870
54+
55+
.PHONY: run
56+
run: clean
57+
docker run -p $(nrepl_port):3850 -p $(oz_port):3860 -p $(jupyter_port):3870 -v ${PWD}:/app -e CHOKIDAR_USEPOLLING=true polis-analysis-docker
58+

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
## Setup
3+
4+
First install Docker, however you'd like to do that for your system.
5+
6+
For Ubuntu-like Linux,
7+
```
8+
sudo apt-get install docker.io
9+
sudo systemctl start docker
10+
sudo systemctl enable docker
11+
```
12+
13+
See https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04
14+
15+
If you don't want to have to run Docker with sudo, see:
16+
17+
```
18+
https://docs.docker.com/engine/install/linux-postinstall/
19+
```
20+
21+
The rest of these instructions assume this has been run.
22+
23+
## Building docker image
24+
25+
Clone the code, cd in, then
26+
27+
```
28+
make build
29+
```
30+
31+
## Running docker image
32+
33+
Once you've built the image (see above), you can run
34+
35+
```
36+
make run
37+
```
38+
39+
40+
41+

bin/run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
jupyter notebook --allow-root --ip 0.0.0.0 --port=3870 &
3+
clojure -R:nREPL -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" --port 3850
4+
5+
6+
#jupyter notebook --port=3870 &
7+
#P1=$!
8+
#clojure -R:nREPL -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" --port 3850 &
9+
#P2=$!
10+
#wait $P1 $P2
11+
12+
#(trap 'kill 0' SIGINT; clojure -R:nREPL -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" &\
13+
#jupyter notebook --port=8890)
14+

data/biodiversity/comments.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:de84b8c9d9b4b70d4929ee0603aa242ba60f53cc456dbf03a62719f1abc16165
3+
size 52444
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:58aaff458ef8dc5679e683e990c8aab3c56bcca82a7929b06b1559d4a04f29e0
3+
size 213160

0 commit comments

Comments
 (0)