Skip to content

Commit 08e3efa

Browse files
committed
Updated Spark to 2.4.5, infra Makefile revamp
1 parent abf3527 commit 08e3efa

File tree

6 files changed

+31
-18
lines changed

6 files changed

+31
-18
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
layout python3
2+
# use sdk java 8.0.232.hs-adpt
23
export VBOXMANAGE=/Applications/VirtualBox.app/Contents/MacOS
34
export SPARK_HOME=$(pwd)/.spark
45
export PATH=$SPARK_HOME/bin:$VBOXMANAGE:$PATH

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ node_modules
66
alt/
77
checkpoint
88
metastore_db/
9-
.spark/
9+
.spark*/
1010
.vagrant/
1111
out/
1212
__pycache__/

infra/docker/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ RUN apt-get update && \
66
apt-get install -y --no-install-recommends python3-software-properties python3-numpy curl && \
77
rm -rf /var/lib/apt/lists/*
88

9+
ARG SPARK_VERSION=2.4.5
910
ENV SPARK_HOME=/opt/spark
10-
RUN mkdir -p /opt/spark && curl -s http://apache.rediris.es/spark/spark-2.4.4/spark-2.4.4-bin-hadoop2.7.tgz | tar -xz -C "${SPARK_HOME}" --strip-components=1
11+
RUN mkdir -p /opt/spark && curl -s http://apache.rediris.es/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}-bin-hadoop2.7.tgz | tar -xz -C "${SPARK_HOME}" --strip-components=1
1112
ENV PATH=$SPARK_HOME/bin:$SPARK_HOME/sbin:$PATH
1213

1314
RUN cp "${SPARK_HOME}/conf/log4j.properties.template" "${SPARK_HOME}/conf/log4j.properties" && \

infra/docker/Makefile

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1-
.PHONY: all build tag push list
1+
SPARK_VERSION:=2.4.5
2+
COURSE_VERSION:=2020.1
3+
IMAGE_NAME:=luisbelloch/spark
24

3-
all: build tag
5+
.PHONY: help
6+
help:
7+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(lastword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
48

5-
build:
6-
docker build -t luisbelloch/spark .
9+
.PHONY: all
10+
all: build tag ## Builds and tags an image
711

8-
tag:
9-
docker tag luisbelloch/spark luisbelloch/spark:2.4.4
10-
docker tag luisbelloch/spark luisbelloch/spark:2019.2
12+
.PHONY: build
13+
build: ## Assembles image from Spark binaries
14+
docker build --build-arg SPARK_VERSION=${SPARK_VERSION} -t $(IMAGE_NAME) .
1115

12-
push:
13-
docker push luisbelloch/spark:2.4.4
14-
docker push luisbelloch/spark:2019.2
15-
docker push luisbelloch/spark
16+
.PHONY: tag
17+
tag: ## Adds tags to current latest image
18+
docker tag $(IMAGE_NAME) $(IMAGE_NAME):$(SPARK_VERSION)
19+
docker tag $(IMAGE_NAME) $(IMAGE_NAME):$(COURSE_VERSION)
1620

17-
list:
18-
docker images luisbelloch/spark
21+
.PHONY: push
22+
push: ## Uploads images to registry
23+
docker push $(IMAGE_NAME):$(SPARK_VERSION)
24+
docker push $(IMAGE_NAME):$(COURSE_VERSION)
25+
docker push $(IMAGE_NAME)
26+
27+
.PHONY: list
28+
list: ## Lists local generated images
29+
docker images $(IMAGE_NAME)
1930

local_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
set -euo pipefail
3-
SPARK_URL=${SPARK_URL:-http://apache.rediris.es/spark/spark-2.4.4/spark-2.4.4-bin-hadoop2.7.tgz}
3+
SPARK_URL=${SPARK_URL:-http://apache.rediris.es/spark/spark-2.4.5/spark-2.4.5-bin-hadoop2.7.tgz}
44
SPARK_PKG=${SPARK_URL##*/}
55
SPARK_HOME=${SPARK_HOME:-$(pwd)/.spark}
66

playbook.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
- hosts: all
33
vars:
44
spark_home: /opt/spark
5-
spark_pkg_name: spark-2.4.4-bin-hadoop2.7
6-
spark_pkg_url: http://apache.rediris.es/spark/spark-2.4.4/spark-2.4.4-bin-hadoop2.7.tgz
5+
spark_pkg_name: spark-2.4.5-bin-hadoop2.7
6+
spark_pkg_url: http://apache.rediris.es/spark/spark-2.4.5/spark-2.4.5-bin-hadoop2.7.tgz
77

88
tasks:
99
- name: Update all packages to the latest version

0 commit comments

Comments
 (0)