Skip to content

Commit efeb54c

Browse files
standardized classpath to com.databricks.labs; docker and testing config updated.
1 parent 5073547 commit efeb54c

File tree

225 files changed

+794
-731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+794
-731
lines changed

pom.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
44

55
<modelVersion>4.0.0</modelVersion>
6-
<groupId>com.dblabs</groupId>
6+
<groupId>com.databricks.labs</groupId>
77
<artifactId>geobrix</artifactId>
88
<version>0.1.0</version>
99

@@ -312,6 +312,15 @@
312312
</plugins>
313313
</build>
314314
</profile>
315+
<profile>
316+
<!-- local testing `mvn test -PskipScoverage -DskipTests=false -Dsuite=...` -->
317+
<id>skipScoverage</id>
318+
<properties>
319+
<scala.version>2.13.12</scala.version>
320+
<scala.compat.version>2.13</scala.compat.version>
321+
<spark.version>4.0.0</spark.version>
322+
</properties>
323+
</profile>
315324
</profiles>
316325
<distributionManagement>
317326
<repository>

python/vectorx/test/test_legacy_registration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
HERE = Path(__file__).resolve()
99
LIBDIR = (HERE.parents[2] / "lib").resolve() # simpler, robust
10-
candidates = sorted(LIBDIR.glob("spatial-*-jar-with-dependencies.jar"))
10+
candidates = sorted(LIBDIR.glob("geobrix-*-jar-with-dependencies.jar"))
1111
JAR = candidates[-1].resolve()
1212
JAR_URI = JAR.as_uri()
1313

scripts/docker/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,12 @@ RUN cd src/gdal-${GDAL_VERSION} \
100100
&& ldconfig
101101

102102

103-
# Copy binaries to the location expected to be by Mosaic
103+
# Copy binaries to the location expected to be by the project
104104
RUN ln -s $ROOTDIR/lib/libgdal.so /usr/lib/libgdal.so
105105
RUN ln -s $ROOTDIR/lib/libgdal.so.30 /usr/lib/libgdal.so.30
106106
RUN ln -s $ROOTDIR/lib/libgdal.so.30.0.3 /usr/lib/libgdal.so.30.0.3
107-
RUN mkdir -p /usr/lib/jni && ln -s $ROOTDIR/lib/libgdalalljni.so /usr/lib/jni/libgdalalljni.so.30
107+
RUN ln -s $ROOTDIR/lib/jni/libgdalalljni.so /usr/lib/libgdalalljni.so
108+
RUN mkdir -p /usr/lib/jni && ln -s $ROOTDIR/lib/jni/libgdalalljni.so /usr/lib/jni/libgdalalljni.so.30
108109
RUN mkdir -p /usr/lib/ogdi && ln -s $ROOTDIR/lib/libgdal.so /usr/lib/ogdi/libgdal.so
109110

110111
# Add Maven
@@ -114,13 +115,13 @@ ARG BASE_URL=https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries
114115
ARG SHA=bcfe4fe305c962ace56ac7b5fc7a08b87d5abd8b7e89027ab251069faebee516b0ded8961445d6d91ec1985dfe30f8153268843c89aa392733d1a3ec956c9978
115116

116117
RUN mkdir -p $ROOTDIR/share/maven $ROOTDIR/share/maven/ref \
117-
&& echo "Downlaoding maven" \
118+
&& echo "Downloading maven" \
118119
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
119120
\
120121
&& echo "Checking download hash" \
121122
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \
122123
\
123-
&& echo "Unziping maven" \
124+
&& echo "Unzipping maven" \
124125
&& tar -xzf /tmp/apache-maven.tar.gz -C $ROOTDIR/share/maven --strip-components=1 \
125126
\
126127
&& echo "Cleaning and setting links" \
@@ -136,6 +137,7 @@ RUN pip3 install --upgrade pip --ignore-installed --break-system-packages
136137
RUN pip3 install build wheel keplergl ipython pyspark==$SPARK_VERSION --break-system-packages
137138
RUN pip3 install black build isort py4j requests --break-system-packages
138139
RUN pip3 install gdal==$GDAL_VERSION --break-system-packages
140+
RUN pip3 install pytest --break-system-packages
139141

140142
# Clean up
141143
RUN apt-get purge -y --auto-remove $buildDeps \

scripts/docker/build

Lines changed: 0 additions & 2 deletions
This file was deleted.

scripts/docker/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
docker build --platform linux/amd64 -t "geobrix-dev:ubuntu24-gdal311-spark" .
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
docker exec -it mosaic-dev bash
1+
#!/bin/bash
2+
docker exec -it geobrix-dev /bin/bash -c "unset JAVA_TOOL_OPTIONS && cd /root/geobrix && /bin/bash"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
docker build --platform linux/amd64 --no-cache -t "geobrix-dev:ubuntu24-gdal311-spark" ../Dockerfile
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# run from inside docker
3+
# [1] unset variable for this script
4+
echo "\n::: [1] ... unsetting JAVA_TOOL_OPTIONS (probably need to do in container as well) :::"
5+
unset JAVA_TOOL_OPTIONS
6+
7+
# [2] copy custom settings.xml
8+
# - defaults to new skipScoverage profile
9+
# - compliments the pom config (profile sCoverage also added there)
10+
# - sets .m2 folder to be in project
11+
echo "\n::: [2] ... setting up new .m2 (in project) + new skipScoverage profile (as default) :::"
12+
mv /usr/local/share/maven/conf/settings.xml /usr/local/share/maven/conf/settings.xml.BAK
13+
cp /root/geobrix/scripts/docker/m2/settings.xml /usr/local/share/maven/conf
14+
echo " ... mvn active profile(s)\n"
15+
cd /root/geobrix && mvn help:active-profiles
16+
17+
# [3] build JVM code
18+
# this is building for container JDK
19+
# see settings.xml for overrides
20+
echo "\n::: [3] ... maven package - JVM code version? :::\n"
21+
echo " $(javac -version)"
22+
cd /root/geobrix && mvn package -DskipTests
23+
24+
# [4] build python (as needed)
25+
# - refer to dockerfile for what is already built
26+
echo "\n::: [4] ... build python :::\n"
27+
echo 'export JUPYTER_PLATFORM_DIRS=1' >> ~/.bashrc
28+
cp "$(find /root/geobrix/python/lib -name "geobrix-*-jar-with-dependencies.jar")" /usr/local/lib/python3.12/dist-packages/pyspark/jars
29+
cd /root/geobrix/python/gridx && pip install . --break-system-packages
30+
cd /root/geobrix/python/rasterx && pip install . --break-system-packages
31+
cd /root/geobrix/python/vectorx && pip install . --break-system-packages
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# [1] Build the image with 'build_mac.sh':
3+
# [2] Assumes you are executing this from project root, e.g. 'sh scripts/docker/mac/geobrix_docker_mac.sh'
4+
# [3] if you want to run tests within the container shell
5+
# - [a] `unset JAVA_TOOL_OPTIONS` is needed to execute JVM tests
6+
# - [b] then can test e.g. `mvn -X test -DskipTests=false -Dsuites=com.databricks.labs.gbx.ds.WhitelistDSTest`
7+
# and `python3 -m unittest gridx/test/test_bng_registration.py` from ./python dir
8+
# - [c] you may need to run `mvn clean` occasionally
9+
# ... don't need to specify -PskipCoverage (see settings.xml)
10+
# [4] `docker stop geobrix-dev` whenever done to terminate the container
11+
# NOTES:
12+
# * Ignore 'ERRO[0000] error waiting for container: context canceled'
13+
# * Removed --privileged
14+
docker run -q --platform linux/amd64 --name geobrix-dev -p 5005:5005 -p 8888:8888 -p 4040:4040 \
15+
-v $PWD:/root/geobrix -e JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" \
16+
-itd --rm geobrix-dev:ubuntu24-gdal311-spark /bin/bash
17+
18+
docker exec -it geobrix-dev /bin/bash -c "sh /root/geobrix/scripts/docker/extras/docker_init.sh"
19+
docker exec -it geobrix-dev /bin/bash -c "unset JAVA_TOOL_OPTIONS && cd /root/geobrix && /bin/bash"

scripts/docker/m2/settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
|
66
| Default: ${user.home}/.m2/repository
77
-->
8-
<localRepository>/root/mosaic/scripts/docker/m2</localRepository>
8+
<localRepository>/root/geobrix/scripts/docker/m2</localRepository>
99
<activeProfiles>
1010
<activeProfile>skipScoverage</activeProfile>
1111
</activeProfiles>

0 commit comments

Comments
 (0)