Skip to content

Commit 5b558b3

Browse files
committed
Adding dockerfile
1 parent 69bb9ec commit 5b558b3

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM eclipse-temurin:8-jammy
2+
3+
RUN apt update && apt install -y openssh-server vim
4+
RUN service ssh start
5+
6+
RUN mkdir -p /assets/
7+
8+
# Build the jar locally before building docker image
9+
COPY ./target/cassandra-data-migrator-2.9.jar /assets/
10+
11+
COPY ./src/resources/sparkConf.properties /assets/
12+
COPY ./src/resources/partitions.csv /assets/
13+
COPY ./src/resources/primary_key_rows.csv /assets/
14+
COPY ./src/resources/runCommands.txt /assets/
15+
16+
RUN cd /assets && curl -OL https://downloads.datastax.com/dsbulk/dsbulk.tar.gz && tar -xzf ./dsbulk.tar.gz && rm ./dsbulk.tar.gz
17+
RUN cd /assets && curl -OL https://downloads.datastax.com/enterprise/cqlsh-astra.tar.gz && tar -xzf ./cqlsh-astra.tar.gz && rm ./cqlsh-astra.tar.gz
18+
RUN cd /assets && curl -OL https://archive.apache.org/dist/spark/spark-2.4.8/spark-2.4.8-bin-hadoop2.7.tgz && tar -xzf ./spark-2.4.8-bin-hadoop2.7.tgz && rm ./spark-2.4.8-bin-hadoop2.7.tgz
19+
20+
ENV PATH="${PATH}:/assets/dsbulk-1.10.0/bin/:/assets/cqlsh-astra/bin/:/assets/spark-2.4.8-bin-hadoop2.7/bin/"
21+
22+
EXPOSE 22
23+
24+
CMD ["/usr/sbin/sshd","-D"]

pom.xml

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

44
<groupId>datastax.astra.migrate</groupId>
55
<artifactId>cassandra-data-migrator</artifactId>
6-
<version>2.9</version>
6+
<version>2.10</version>
77
<packaging>jar</packaging>
88

99
<properties>

src/resources/runCommands.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
// Download spark
2-
wget https://archive.apache.org/dist/spark/spark-2.4.8/spark-2.4.8-bin-hadoop2.6.tgz
3-
4-
// Increase driver memory
5-
--driver-memory 8G
1+
// Download dependencies
2+
curl -OL https://downloads.datastax.com/dsbulk/dsbulk.tar.gz
3+
curl -OL https://downloads.datastax.com/enterprise/cqlsh-astra.tar.gz
4+
wget https://archive.apache.org/dist/spark/spark-2.4.8/spark-2.4.8-bin-hadoop2.7.tgz
65

76
// Migrate
8-
spark-submit --properties-file /<path>/sparkConf.properties --verbose --master "local[8]" --class datastax.astra.migrate.Migrate /<path>/cassandra-data-migrator-1.x.jar
7+
spark-submit --properties-file /<path>/sparkConf.properties --verbose --master "local[8]" --class datastax.astra.migrate.Migrate /<path>/cassandra-data-migrator-2.x.jar
8+
spark-submit --properties-file /<path>/sparkConf.properties --master "local[8]" --driver-memory 25G --executor-memory 25G --class datastax.astra.migrate.Migrate /<path>/cassandra-data-migrator-2.x.jar &> table_out.log
99

1010
// Random Partitioner Run Command
11-
spark-submit --properties-file /<path>/sparkConf.properties --verbose --master "local[8]" --conf spark.source.minPartition=-1 --conf spark.source.maxPartition=170141183460469231731687303715884105728 --class datastax.astra.migrate.Migrate /<path>/cassandra-data-migrator-1.x.jar
11+
spark-submit --properties-file /<path>/sparkConf.properties --verbose --master "local[8]" --conf spark.origin.minPartition=-1 --conf spark.origin.maxPartition=170141183460469231731687303715884105728 --class datastax.astra.migrate.Migrate /<path>/cassandra-data-migrator-1.x.jar
1212

13-
// Diff Data
14-
spark-submit --properties-file /<path>/sparkConf.properties --verbose --master "local[8]" --class datastax.astra.migrate.DiffData /<path>/cassandra-data-migrator-1.x.jar
13+
// Validate
14+
spark-submit --properties-file /<path>/sparkConf.properties --master "local[8]" --driver-memory 25G --executor-memory 25G --class datastax.astra.migrate.DiffData /<path>/cassandra-data-migrator-2.x.jar &> table_out.log

0 commit comments

Comments
 (0)