Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit 8045a30

Browse files
Docker site (#3393)
* commit * commit * commit * clean up python script. * commit * successfully generating static docs in docker container * clean up * clean up * clean up
1 parent 1dbf1ce commit 8045a30

File tree

6 files changed

+141
-21
lines changed

6 files changed

+141
-21
lines changed

website2/website/package-lock.json

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website2/website/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@
1414
"replace-in-file": "^3.4.0",
1515
"redoc": "^2.0.0-alpha.30"
1616
},
17-
"dependencies": {}
17+
"dependencies": {
18+
"yarn": "^1.19.1"
19+
}
1820
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
FROM ubuntu:18.04
19+
20+
# This is passed to the heron build command via the --config flag
21+
ENV TARGET_PLATFORM ubuntu
22+
ENV bazelVersion 0.26.0
23+
24+
RUN apt-get update && apt-get -y install \
25+
g++ \
26+
cmake \
27+
automake \
28+
libtool-bin \
29+
libunwind8 \
30+
patch \
31+
python-dev \
32+
wget \
33+
zip \
34+
virtualenv \
35+
unzip \
36+
git \
37+
curl \
38+
openjdk-8-jdk-headless \
39+
tree \
40+
python-setuptools \
41+
python-dev \
42+
python-wheel \
43+
python \
44+
python-pip \
45+
curl \
46+
sudo
47+
48+
RUN curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
49+
50+
RUN apt-get update && apt-get install -y nodejs
51+
52+
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
53+
54+
RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
55+
&& chmod +x /tmp/bazel.sh \
56+
&& /tmp/bazel.sh
57+
58+
ADD bazelrc /root/.bazelrc
59+

website2/website/scripts/build-site.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ VERSION=0.20
2323
set -x -e
2424

2525
cd ${ROOT_DIR}/website2/website
26-
27-
yarn
28-
yarn build
26+
#npm install yarn
27+
npm build
2928

3029
node ./scripts/replace.js
3130

3231
rm -rf ${ROOT_DIR}/generated-site/content
3332
mkdir -p ${ROOT_DIR}/generated-site/content
3433
## copy generated site
3534
cp -R build/incubator-heron/* ${ROOT_DIR}/generated-site/content
36-
## copy java docs
37-
cp -R ${ROOT_DIR}/website2/website/public/api/java/* ${ROOT_DIR}/generated-site/content/api/java/
35+
## copy java docs website2/website/static/api
36+
cp -R ${ROOT_DIR}/website2/website/static/api/* ${ROOT_DIR}/generated-site/content/api/java/
3837
## copy pydocs
39-
cp -R ${ROOT_DIR}/website2/website/static/api/python/* ${ROOT_DIR}/generated-site/content/api/python/
38+
cp -R ${ROOT_DIR}/website2/website/static/api/python/* ${ROOT_DIR}/generated-site/content/api/python/
39+
## remove bazelrc for dockerfile
40+
rm ${ROOT_DIR}/website2/website/scripts/bazelrc
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
set -o nounset
19+
set -o errexit
20+
21+
realpath() {
22+
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
23+
}
24+
25+
DOCKER_DIR=$(dirname $(dirname $(realpath $0)))
26+
echo "docker dir: $DOCKER_DIR"
27+
PROJECT_DIR=$(dirname $DOCKER_DIR)
28+
echo "project dir: $PROJECT_DIR"
29+
30+
verify_dockerfile_exists() {
31+
if [ ! -f $1 ]; then
32+
echo "The Dockerfile $1 does not exist"
33+
exit 1
34+
fi
35+
}
36+
37+
dockerfile_path_for_platform() {
38+
echo "$PROJECT_DIR/website/scripts/Dockerfile.$1"
39+
}
40+
41+
copy_bazel_rc_to() {
42+
cp $PROJECT_DIR/../tools/docker/bazel.rc $1
43+
}
44+
45+
46+
47+
TARGET_PLATFORM="ubuntu18.04"
48+
DOCKER_FILE=$(dockerfile_path_for_platform $TARGET_PLATFORM)
49+
verify_dockerfile_exists $DOCKER_FILE
50+
copy_bazel_rc_to $PROJECT_DIR/website/scripts/bazelrc
51+
52+
echo "docker file"
53+
echo $DOCKER_FILE
54+
55+
echo "Building heron-compiler container"
56+
docker build -t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE .
57+
58+
59+
docker run \
60+
--rm \
61+
-v $PROJECT_DIR/..:/dist \
62+
-t heron-compiler:$TARGET_PLATFORM make -C /dist/website2/website/ buildsite
63+

website2/website/scripts/python-doc-gen.sh

+3-13
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,28 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818

19-
# Install Dependencies
20-
#sudo apt-get update && sudo apt install -y automake cmake libtool-bin g++ \
21-
# python-setuptools python-dev python-wheel python python-pip unzip tree openjdk-8-jdk virtualenv
22-
23-
# Install Bazel 0.26
24-
#wget -O ./bazel-0.26.0-installer-linux-x86_64.sh https://github.com/bazelbuild/bazel/releases/download/0.26.0/bazel-0.26.0-installer-linux-x86_64.sh && \
25-
# chmod +x ./bazel-0.26.0-installer-linux-x86_64.sh && \
26-
#./bazel-0.26.0-installer-linux-x86_64.sh --user && \
27-
# export PATH="$PATH:$HOME/bin"
28-
2919
set -e
3020

3121
HERONPY_VERSION=$1
3222
HERON_ROOT_DIR=$(git rev-parse --show-toplevel)
3323
cd ${HERON_ROOT_DIR}
3424

35-
# ./bazel_configure.py
25+
./bazel_configure.py
3626

3727
# Generate python whl packages, packages will be generated in ${HERON_ROOT_DIR}/bazel-genfiles/scripts/packages/
38-
bazel build --config=ubuntu scripts/packages:pypkgs
28+
bazel build --config=ubuntu scripts/packages:pypkgs
3929

4030
cd website2/website/
4131
mkdir -p ./tmp/
4232
TMP_DIR=./tmp
33+
rm -rf ./venv/
4334
mkdir -p ./venv/
4435
VENV=./venv/
4536
echo $VENV
4637
PIP_LOCATION=${HERON_ROOT_DIR}/bazel-genfiles/scripts/packages
4738

4839
virtualenv "$VENV"
4940
source "$VENV/bin/activate"
50-
5141
pip install pdoc==0.3.2
5242
pip install --ignore-installed six
5343
# Install the heronpy

0 commit comments

Comments
 (0)