Skip to content

Commit

Permalink
Reorganize the scripts for GIE launching (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
acezen committed Aug 6, 2021
1 parent eb71eef commit 032ed99
Show file tree
Hide file tree
Showing 75 changed files with 1,031 additions and 1,654 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ jobs:
cd ${GITHUB_WORKSPACE}
tar -cf gie.tar interactive_engine/src/executor/target/release/executor \
interactive_engine/src/executor/store/log4rs.yml \
interactive_engine/deploy/docker/dockerfile
interactive_engine/bin \
interactive_engine/conf
- uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -239,8 +240,7 @@ jobs:
mvn clean package -DskipTests -Pjava-release --quiet
cd ${GITHUB_WORKSPACE}
tar -cf manager.tar interactive_engine/src/assembly/target/0.0.1-SNAPSHOT.tar.gz \
interactive_engine/src/instance-manager/target/0.0.1-SNAPSHOT.tar.gz \
interactive_engine/deploy/docker/dockerfile
interactive_engine/src/instance-manager/target/0.0.1-SNAPSHOT.tar.gz
- uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -526,13 +526,15 @@ jobs:
cd ${GITHUB_WORKSPACE}
mv interactive_engine/distribution/target/maxgraph.tar.gz ./
tar -zcf lib.tar.gz /opt/graphscope
tar -zcf giectl.tar.gz interactive_engine/bin interactive_engine/conf
- uses: actions/upload-artifact@v2
with:
name: gss-${{ github.sha }}
path: |
maxgraph.tar.gz
lib.tar.gz
giectl.tar.gz
retention-days: 5

gss-test:
Expand Down Expand Up @@ -566,6 +568,7 @@ jobs:
pushd artifacts
tar -zxf ./gss-${{ github.sha }}/lib.tar.gz
tar -zxf ./gss-${{ github.sha }}/maxgraph.tar.gz
tar -zxf ./gss-${{ github.sha }}/giectl.tar.gz
sudo docker pull registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-runtime:latest
sudo docker build -t registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-store:${{ github.sha }} \
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/graphscope-store.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
FROM registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-runtime:latest

RUN mkdir -p /home/maxgraph
RUN mkdir -p /home/maxgraph/{bin,conf}
COPY ./opt/graphscope/ /usr/local/
COPY ./maxgraph /home/maxgraph/maxgraph
COPY ./ready_probe.sh /tmp/ready_probe.sh
COPY ./interactive_engine/bin/giectl /home/maxgraph/bin/giectl
COPY ./interactive_engine/conf/* /home/maxgraph/conf/

ENV GRAPHSCOPE_HOME=/home/maxgraph
ENV GRAPHSCOPE_RUNTIME=/tmp/graphscope

WORKDIR /home/maxgraph/
16 changes: 6 additions & 10 deletions .github/workflows/graphscope.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ ARG profile=release
COPY ./opt/graphscope/ /usr/local/
RUN cd /usr/local/dist/ && pip3 install ./*.whl

RUN mkdir -p /home/maxgraph
RUN mkdir -p /home/maxgraph/{bin,conf}
ENV VINEYARD_IPC_SOCKET /home/maxgraph/data/vineyard/vineyard.sock
COPY ./interactive_engine/src/executor/target/release/executor /home/maxgraph/executor
COPY ./interactive_engine/src/executor/target/release/executor /home/maxgraph/bin/executor
COPY ./interactive_engine/bin/giectl /home/maxgraph/bin/giectl

COPY ./interactive_engine/src/executor/store/log4rs.yml /home/maxgraph/log4rs.yml
RUN mkdir -p /home/maxgraph/native
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/home/maxgraph/native

Expand All @@ -20,10 +20,6 @@ RUN pip3 install git+https://github.com/mars-project/mars.git@35b44ed56e031c252e
ENV RUST_BACKTRACE=1

# copy start script from builder
RUN mkdir -p /home/maxgraph/config
COPY ./interactive_engine/deploy/docker/dockerfile/executor-entrypoint.sh /home/maxgraph/executor-entrypoint.sh
COPY ./interactive_engine/deploy/docker/dockerfile/executor.vineyard.properties /home/maxgraph/config/executor.application.properties

RUN mkdir -p /root/maxgraph
COPY ./interactive_engine/deploy/docker/dockerfile/set_config.sh /root/maxgraph/set_config.sh
COPY ./interactive_engine/deploy/docker/dockerfile/kill_process.sh /root/maxgraph/kill_process.sh
COPY ./interactive_engine/conf/* /home/maxgraph/conf/
ENV GRAPHSCOPE_HOME=/home/maxgraph
ENV GRAPHSCOPE_RUNTIME=/tmp/graphscope
8 changes: 4 additions & 4 deletions .github/workflows/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ jobs:
run: |
/bin/bash ${GITHUB_WORKSPACE}/scripts/deploy_local.sh build_and_deploy --verbose
- name: DEBUG
if: false
uses: mxschmitt/action-tmate@v2

- name: Run Local Test
env:
OS : ${{ matrix.os }}
Expand All @@ -88,6 +84,10 @@ jobs:
# delete etcd dir
rm -fr /tmp/default.etcd || true
- name: DEBUG
if: false
uses: mxschmitt/action-tmate@v2

- name: Run Gaia on Maxgraph Store Test
if: matrix.os == 'ubuntu-20.04'
run: |
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/manager.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@ RUN mkdir -p /home/maxgraph
# copy binary from builder
COPY ./interactive_engine/src/assembly/target/0.0.1-SNAPSHOT.tar.gz /home/maxgraph/
COPY ./interactive_engine/src/instance-manager/target/0.0.1-SNAPSHOT.tar.gz /home/maxgraph/instance-0.0.1-SNAPSHOT.tar.gz
# copy start script from builder
COPY ./interactive_engine/deploy/docker/dockerfile/coordinator-entrypoint.sh /home/maxgraph/coordinator-entrypoint.sh
RUN mkdir -p /home/maxgraph/config
COPY ./interactive_engine/deploy/docker/dockerfile/coordinator.application.properties /home/maxgraph/config/coordinator.application.properties
RUN tar -xf /home/maxgraph/0.0.1-SNAPSHOT.tar.gz -C /home/maxgraph
RUN tar -xf /home/maxgraph/instance-0.0.1-SNAPSHOT.tar.gz -C /home/maxgraph
# copy bin and config from builder
RUN mkdir -p /home/maxgraph/{bin,conf}
COPY ./interactive_engine/bin/giectl /home/maxgraph/bin/giectl
COPY ./interactive_engine/conf/* /home/maxgraph/conf/

COPY ./interactive_engine/deploy/docker/dockerfile/frontend-entrypoint.sh /home/maxgraph/frontend-entrypoint.sh
COPY ./interactive_engine/deploy/docker/dockerfile/frontend.vineyard.properties /home/maxgraph/config/frontend.application.properties
COPY ./interactive_engine/deploy/docker/dockerfile/manager-entrypoint.sh /home/maxgraph/manager-entrypoint.sh

COPY ./interactive_engine/deploy/docker/dockerfile/create_maxgraph_instance.sh /root/maxgraph/create_maxgraph_instance.sh
COPY ./interactive_engine/deploy/docker/dockerfile/delete_maxgraph_instance.sh /root/maxgraph/delete_maxgraph_instance.sh
COPY ./interactive_engine/deploy/docker/dockerfile/kill_process.sh /root/maxgraph/kill_process.sh
COPY ./interactive_engine/deploy/docker/dockerfile/set_config.sh /root/maxgraph/set_config.sh
COPY ./interactive_engine/deploy/docker/dockerfile/func.sh /root/maxgraph/func.sh
COPY ./interactive_engine/deploy/docker/dockerfile/pod.yaml /root/maxgraph/pod.yaml
COPY ./interactive_engine/deploy/docker/dockerfile/expose_gremlin_server.sh /root/maxgraph/expose_gremlin_server.sh
ENV GRAPHSCOPE_HOME=/home/maxgraph
ENV GRAPHSCOPE_RUNTIME=/tmp/graphscope

WORKDIR /home/maxgraph/
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ gie:
cargo build --all
# install
mkdir -p $(WORKING_DIR)/.install_prefix && \
mkdir -p $(WORKING_DIR)/.install_prefix/bin && \
mkdir -p $(WORKING_DIR)/.install_prefix/conf && \
tar -xf $(WORKING_DIR)/interactive_engine/src/instance-manager/target/0.0.1-SNAPSHOT.tar.gz -C $(WORKING_DIR)/.install_prefix && \
tar -xf $(WORKING_DIR)/interactive_engine/src/assembly/target/0.0.1-SNAPSHOT.tar.gz -C $(WORKING_DIR)/.install_prefix && \
mkdir -p $(WORKING_DIR)/.install_prefix/coordinator $(WORKING_DIR)/.install_prefix/frontend/frontendservice $(WORKING_DIR)/.install_prefix/conf && \
cp -r $(WORKING_DIR)/interactive_engine/src/coordinator/target $(WORKING_DIR)/.install_prefix/coordinator && \
cp -r $(WORKING_DIR)/interactive_engine/src/frontend/frontendservice/target $(WORKING_DIR)/.install_prefix/frontend/frontendservice && \
cp $(WORKING_DIR)/interactive_engine/src/executor/target/debug/executor $(WORKING_DIR)/.install_prefix/bin/executor && \
cp $(WORKING_DIR)/interactive_engine/src/executor/target/debug/gaia_executor $(WORKING_DIR)/.install_prefix/bin/gaia_executor && \
cp $(WORKING_DIR)/interactive_engine/src/executor/store/log4rs.yml $(WORKING_DIR)/.install_prefix/conf/log4rs.yml && \
cp -r $(WORKING_DIR)/interactive_engine/bin/* $(WORKING_DIR)/.install_prefix/bin/ && \
cp -r $(WORKING_DIR)/interactive_engine/conf/* $(WORKING_DIR)/.install_prefix/conf/ && \
sudo cp -r $(WORKING_DIR)/.install_prefix/* $(INSTALL_PREFIX) && \
rm -fr $(WORKING_DIR)/.install_prefix

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ spec:
-e "s/INGESTOR/$(DNS_NAME_PREFIX_INGESTOR)/g" \
-e "s/COORDINATOR/$(DNS_NAME_PREFIX_COORDINATOR)/g" \
-e "s/STORE/$(DNS_NAME_PREFIX_STORE)/g" \
-e "s@LOG4RS_CONFIG@${GRAPHSCOPE_HOME}/conf/log4rs.yml@g" \
/etc/graphscope-store/my.cnf.tpl > /etc/graphscope-store/my.cnf
LOG_NAME=graphscope-store.log MAXGRAPH_CONF_FILE=/etc/graphscope-store/my.cnf /home/maxgraph/maxgraph/bin/maxgraph.sh coordinator
LOG_NAME=graphscope-store.log /home/maxgraph/bin/giectl maxgraph /etc/graphscope-store/my.cnf coordinator
tail -f /dev/null
env:
- name: DEBUG
Expand Down
3 changes: 2 additions & 1 deletion charts/graphscope-store/templates/frontend/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ spec:
-e "s/INGESTOR/$(DNS_NAME_PREFIX_INGESTOR)/g" \
-e "s/COORDINATOR/$(DNS_NAME_PREFIX_COORDINATOR)/g" \
-e "s/STORE/$(DNS_NAME_PREFIX_STORE)/g" \
-e "s@LOG4RS_CONFIG@${GRAPHSCOPE_HOME}/conf/log4rs.yml@g" \
/etc/graphscope-store/my.cnf.tpl > /etc/graphscope-store/my.cnf
LOG_NAME=graphscope-store.log MAXGRAPH_CONF_FILE=/etc/graphscope-store/my.cnf /home/maxgraph/maxgraph/bin/maxgraph.sh $(EXECUTOR)
LOG_NAME=graphscope-store.log /home/maxgraph/bin/giectl maxgraph /etc/graphscope-store/my.cnf $(EXECUTOR)
tail -f /dev/null
env:
- name: DEBUG
Expand Down
3 changes: 2 additions & 1 deletion charts/graphscope-store/templates/ingestor/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ spec:
-e "s/INGESTOR/$(DNS_NAME_PREFIX_INGESTOR)/g" \
-e "s/COORDINATOR/$(DNS_NAME_PREFIX_COORDINATOR)/g" \
-e "s/STORE/$(DNS_NAME_PREFIX_STORE)/g" \
-e "s@LOG4RS_CONFIG@${GRAPHSCOPE_HOME}/conf/log4rs.yml@g" \
/etc/graphscope-store/my.cnf.tpl > /etc/graphscope-store/my.cnf
LOG_NAME=graphscope-store.log MAXGRAPH_CONF_FILE=/etc/graphscope-store/my.cnf /home/maxgraph/maxgraph/bin/maxgraph.sh ingestor
LOG_NAME=graphscope-store.log /home/maxgraph/bin/giectl maxgraph /etc/graphscope-store/my.cnf ingestor
tail -f /dev/null
env:
- name: DEBUG
Expand Down
3 changes: 2 additions & 1 deletion charts/graphscope-store/templates/store/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ spec:
-e "s/INGESTOR/$(DNS_NAME_PREFIX_INGESTOR)/g" \
-e "s/COORDINATOR/$(DNS_NAME_PREFIX_COORDINATOR)/g" \
-e "s/STORE/$(DNS_NAME_PREFIX_STORE)/g" \
-e "s@LOG4RS_CONFIG@${GRAPHSCOPE_HOME}/conf/log4rs.yml@g" \
/etc/graphscope-store/my.cnf.tpl > /etc/graphscope-store/my.cnf
LOG_NAME=graphscope-store.log MAXGRAPH_CONF_FILE=/etc/graphscope-store/my.cnf /home/maxgraph/maxgraph/bin/maxgraph.sh $(EXECUTOR)
LOG_NAME=graphscope-store.log /home/maxgraph/bin/giectl maxgraph /etc/graphscope-store/my.cnf $(EXECUTOR)
tail -f /dev/null
env:
- name: DEBUG
Expand Down
4 changes: 2 additions & 2 deletions charts/graphscope-store/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ executorWorkerPerProcess: 2
executorQueryThreadCount: 2
executorQueryManagerThreadCount: 2
executorQueryStoreThreadCount: 2
log4rsConfig: "./conf/log4rs.yml"
log4rsConfig: "LOG4RS_CONFIG"



Expand Down Expand Up @@ -233,7 +233,7 @@ store:
selector: {}

initContainers: []


## GraphScope store Service parameters
##
Expand Down
6 changes: 5 additions & 1 deletion coordinator/gscoordinator/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,11 @@ def _create_interactive_engine_service(self):
# add manager container
graph_manager_builder.add_manager_container(
cmd=["/bin/bash", "-c", "--"],
args=["/home/maxgraph/manager-entrypoint.sh"],
args=[
"/home/maxgraph/bin/giectl start_manager_service k8s {} 0 {}".format(
self._interactive_engine_manager_port, self._zookeeper_port
)
],
name=self._gie_manager_container_name,
image=self._saved_locals["gie_graph_manager_image"],
cpu=self._saved_locals["gie_graph_manager_cpu"],
Expand Down
7 changes: 4 additions & 3 deletions coordinator/gscoordinator/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,11 @@ def _launch_zookeeper(self):

def _launch_graph_manager(self):
port = self._get_free_port(self._hosts.split(",")[0])
gm_sh = os.path.join(self._graphscope_home, "bin", "start.sh")
gm_sh = os.path.join(self._graphscope_home, "bin", "giectl")
cmd = [
"bash",
gm_sh,
"start_manager_service",
"local",
str(port),
self._instance_id,
Expand Down Expand Up @@ -425,8 +426,8 @@ def _stop_interactive_engine_service(self):
self._stop_subprocess(self._graph_manager_process)
self._graph_manager_endpoint = None

gm_stop_sh = os.path.join(self._graphscope_home, "bin", "stop.sh")
cmd = ["bash", gm_stop_sh, "local", self._instance_id]
gm_stop_sh = os.path.join(self._graphscope_home, "bin", "giectl")
cmd = ["bash", gm_stop_sh, "stop_manager_service", "local", self._instance_id]

process = subprocess.Popen( # noqa: F841
cmd,
Expand Down
Loading

0 comments on commit 032ed99

Please sign in to comment.