-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Dockerfile for server & studio (0.10) #845
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
1. Add hosts to speed up image download 2. Modify some configs to enable the server to run better in container 3. Because Dockerfile doesn't allow multiple startup commands, currently only the server will be automatically started after the container is started. If you want to start studio, you can enter the container to start it. Here is a simple container start command: ```bash docker run -it --name=graph -p 18080:8080 -p 18088:8088 hugegraph:0.10 /bin/bash ```
139ecbd
to
e9be45c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job
Dockerfile
Outdated
RUN set -e \ | ||
&& echo "192.30.253.112 github.com\n151.101.44.249 github.global.ssl.fastly.net" >> /etc/hosts \ | ||
&& mkdir -p /root/server \ | ||
&& curl -L -S ${PKG_URL}/hugegraph/releases/download/v0.10.4/hugegraph-0.10.4.tar.gz -o /root/server.tar.gz \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer to add an env var for version
&& tar xzf /root/server.tar.gz --strip-components 1 -C /root/server \ | ||
&& rm /root/server.tar.gz \ | ||
&& cd /root/server/ \ | ||
&& sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it be a real ip instead of 0.0.0.0
Dockerfile
Outdated
|
||
# 2. Init HugeGraph Sever (speed up) | ||
RUN set -e \ | ||
&& echo "192.30.253.112 github.com\n151.101.44.249 github.global.ssl.fastly.net" >> /etc/hosts \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the ip stable?
@@ -0,0 +1,46 @@ | |||
FROM ubuntu:xenial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also support centos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can only write a basically similar Dockerfile for CentOS. (Generally use Debian/Ubuntu
)
Usually , I haven't seen the official image provide two types of Dockerfile,
Maybe we can see the opinions of other community users.
And here are some refers:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Dockerfile
Outdated
EXPOSE 8088 | ||
WORKDIR /root | ||
|
||
ENTRYPOINT ["./server/bin/start-hugegraph.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace server with hugegraph-server
&& sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties \ | ||
&& sed -n '63p' ./bin/start-hugegraph.sh | grep "&" > /dev/null && sed -i 63{s/\&$/#/g} ./bin/start-hugegraph.sh \ | ||
&& sed -n '74p' ./bin/start-hugegraph.sh | grep "exit" > /dev/null && sed -i 74{s/^/#/g} ./bin/start-hugegraph.sh \ | ||
&& ./bin/init-store.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a shell install-server.sh to improve readability?
some references found https://github.com/search?l=Dockerfile&p=99&q=RUN++install.sh&type=Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need test it:
if there is a file named start.sh
echo "old msg"
RUN start.sh
RUN echo "old msg" && echo "new msg"
If we use a shell file to change the code, would dockerfile think this is a repeated step and skip the rebuild?
Dockerfile
Outdated
RUN set -e \ | ||
&& echo "192.30.253.112 github.com\n151.101.44.249 github.global.ssl.fastly.net" >> /etc/hosts \ | ||
&& mkdir -p /root/studio \ | ||
&& curl -L -S ${PKG_URL}/hugegraph-studio/releases/download/v0.10.0/hugegraph-studio-0.10.0.tar.gz -o /root/studio.tar.gz \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems no studio tar when building server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may need to also trigger docker image building when studio release to resolve it.
and what is the behavior if studio tar don't exist: hugegraph-studio / releases / download / v0.10.0 / hugegraph-studio-0.10.0.tar.gz
?
d511abe
to
4da4b87
Compare
Dockerfile
Outdated
lsof \ | ||
g++ \ | ||
gcc \ | ||
openjdk-8-jdk \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge the 11-15 lines, and align with apt-get
Dockerfile
Outdated
# 3. Prepare for HugeGraph Studio | ||
ENV STUDIO_VERSION 0.10.0 | ||
RUN set -e \ | ||
&& echo "192.30.253.112 github.com\n151.101.44.249 github.global.ssl.fastly.net" >> /etc/hosts \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove it since added when building server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each layer of docker image use a separate network layer.
So when leave current layer(step), other step cannot reuse it
And other ways are troublesome to solve it, like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Github-IP is not fixed, comment it now 2. For the convenience of users, the apt-source is not cleared by default.
update auth default config in rest-server.properties
Also update default values for auth for #706 |
There are indeed some errors, please update default value to ConfigAuthenticator: |
@imbajin Can you split the commits not related to docker? |
revert
OK, maybe it's better to update all the configuration files & shells separately later |
@@ -42,7 +42,7 @@ cassandra.password= | |||
# hbase backend config | |||
#hbase.hosts=localhost | |||
#hbase.port=2181 | |||
#hbase.znode_parent=/hbsae | |||
#hbase.znode_parent=/hbase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also move it to independent commit
1. Add hosts to speed up image download 2. Modify some configs to enable the server to run better in container 3. Because Dockerfile doesn't allow multiple startup commands, currently only the server will be automatically started after the container is started. If you want to start studio, you can enter the container to start it. Here is a simple container start command: ```bash docker run -it --name=graph -p 18080:8080 -p 18088:8088 hugegraph:0.10 /bin/bash ``` 1. Github-IP is not fixed, comment it now 2. For the convenience of users, the apt-source is not cleared by default.
Fix #1284 / Fix #840 / Fix #989 :
Here are some simple using commands:
TODOs:
docker-compose
to manage them.After the above completed, it can provides a one-click pure test environment for graph