Skip to content

Commit fca0956

Browse files
committed
Update devcontainer.
1 parent 2603dab commit fca0956

6 files changed

Lines changed: 81 additions & 2593 deletions

File tree

.devcontainer/Dockerfile.dev

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM continuumio/miniconda3:25.11.1@sha256:5df7c31c16e90e4ea370836770feed507a1cf51c6e8aad835c65fb26b9eca941
2+
RUN apt-get update \
3+
&& apt-get install -y --no-install-recommends \
4+
curl wget build-essential openjdk-21-jdk \
5+
&& rm -rf /var/lib/apt/lists/*
6+
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
7+
ENV LUCENE_VERSION=10.0.0
8+
ENV ANT_VERSION=1.10.14
9+
ENV PATH=$PATH:/pybool_ir/ant/bin:/opt/conda/bin
10+
ENV MIRROR=downloads
11+
ENV JCC_JDK=${JAVA_HOME}
12+
ENV JCC_ARGSEP=";"
13+
ENV JCC_LFLAGS="-L$JAVA_HOME/lib;-ljava;-L$JAVA_HOME/lib/server;-ljvm;-Wl,-rpath=$JAVA_HOME/lib:$JAVA_HOME/lib/server"
14+
ENV JCC="python -m jcc --wheel"
15+
WORKDIR /pybool_ir
16+
RUN curl -O https://${MIRROR}.apache.org/lucene/pylucene/pylucene-${LUCENE_VERSION}-src.tar.gz \
17+
&& gunzip pylucene-${LUCENE_VERSION}-src.tar.gz \
18+
&& tar -xvf pylucene-${LUCENE_VERSION}-src.tar \
19+
&& rm pylucene-${LUCENE_VERSION}-src.tar \
20+
&& ln -s pylucene-${LUCENE_VERSION} pylucene \
21+
&& curl -O https://${MIRROR}.apache.org/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz \
22+
&& gunzip apache-ant-${ANT_VERSION}-bin.tar.gz \
23+
&& tar -xvf apache-ant-${ANT_VERSION}-bin.tar \
24+
&& rm apache-ant-${ANT_VERSION}-bin.tar \
25+
&& ln -s apache-ant-${ANT_VERSION} ant
26+
RUN cd pylucene/jcc \
27+
&& python setup.py build \
28+
&& python setup.py install
29+
RUN cd pylucene \
30+
&& NUM_FILES=10 make
31+
RUN pip install pylucene/dist/*.whl

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
3+
{
4+
"name": "Existing Dockerfile",
5+
"build": {
6+
// Sets the run context to one level up instead of the .devcontainer folder.
7+
"context": "..",
8+
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
9+
"dockerfile": "Dockerfile.dev",
10+
"options": [
11+
"--platform=linux/amd64"
12+
]
13+
},
14+
15+
// Features to add to the dev container. More info: https://containers.dev/features.
16+
// "features": {},
17+
18+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19+
// "forwardPorts": [],
20+
21+
// Uncomment the next line to run commands after the container is created.
22+
"postCreateCommand": "bash ./.devcontainer/postCreateCommands.sh",
23+
24+
// Configure tool-specific properties.
25+
"customizations": {
26+
// Set *default* container specific settings.json values on container create.
27+
"settings": {
28+
// Add the IDs of extensions you want installed when the container is created.
29+
"extensions": [
30+
"ms-python.python",
31+
"ms-python.vscode-pylance"
32+
]
33+
}
34+
}
35+
36+
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
37+
// "remoteUser": "devcontainer"
38+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pip install uv
2+
uv add /pybool_ir/pylucene/dist/*.whl
3+
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
4+
export JCC_JDK=${JAVA_HOME}
5+
export JCC_ARGSEP=";"
6+
export JCC_LFLAGS="-L$JAVA_HOME/lib;-ljava;-L$JAVA_HOME/lib/server;-ljvm;-Wl,-rpath=$JAVA_HOME/lib:$JAVA_HOME/lib/server"
7+
export JCC="python -m jcc --wheel"
8+
uv add /pybool_ir/pylucene/jcc
9+
uv pip install -e .
10+
uv sync

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ __pycache__
2020

2121
*.jsonl
2222
hs_err_pid*
23+
uv.lock
24+
pyproject.toml

pyproject.toml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ dependencies = [
1414
"furo>=2024.8.6",
1515
"ir-datasets>=0.5.11",
1616
"ir-measures>=0.3.7",
17-
"jcc>=3.15",
1817
"jupyter>=1.1.1",
1918
"jupyterlab>=4.4.4",
20-
"lucene",
2119
"lupyne>=3.3",
2220
"networkx>=3.4.2",
2321
"parsedatetime>=2.6",
@@ -31,12 +29,3 @@ dependencies = [
3129
"twine>=6.1.0",
3230
"wget>=3.2",
3331
]
34-
35-
[dependency-groups]
36-
dev = [
37-
"pybool-ir",
38-
]
39-
40-
[tool.uv.sources]
41-
pybool-ir = { workspace = true }
42-
lucene = { path = "pylucene/dist/lucene-10.0.0-cp313-cp313-macosx_11_0_arm64.whl" }

0 commit comments

Comments
 (0)