You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@linkis.apache.org by GitBox <gi...@apache.org> on 2022/07/09 13:04:02 UTC

[GitHub] [incubator-linkis] AaronLinOops opened a new pull request, #2447: [Feature] add Dockerfile to linkis-dist module for both linkis backen and web

AaronLinOops opened a new pull request, #2447:
URL: https://github.com/apache/incubator-linkis/pull/2447

   ### What is the purpose of the change
   Introduce some maven profiles to build web and create docker images with Maven command line.
   
   ### Brief change log
   - Add a maven profile 'docker' to build docker image for Apache Linkis
   -  Add a maven profile 'web' to build web and its image
   
   ### Verifying this change
   (Please pick either of the following options)  
   This change is a trivial rework / code cleanup without any test coverage.  
   
   ### Does this pull request potentially affect one of the following parts:
   - Dependencies (does it add or upgrade a dependency): (no)
   - Anything that affects deployment: (no)
   - The MGS(Microservice Governance Services), i.e., Spring Cloud Gateway, OpenFeign, Eureka.: (no)
   
   ### Documentation
   - Does this pull request introduce a new feature? (yes)
   - If yes, how is the feature documented? (docs later)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org


[GitHub] [incubator-linkis] legendtkl commented on a diff in pull request #2447: [Feature] Add Dockerfile to linkis-dist module for both linkis backends and web

Posted by GitBox <gi...@apache.org>.
legendtkl commented on code in PR #2447:
URL: https://github.com/apache/incubator-linkis/pull/2447#discussion_r917378937


##########
linkis-dist/package/sbin/ext/linkis-mg-gateway:
##########
@@ -76,16 +76,29 @@ fi
 export SERVER_CLASS_PATH=$SERVER_CONF_PATH:$SERVER_LIB/*
 
 echo  "=====Java Start Command====="
-echo  "nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &"
 
-nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 >  $LINKIS_LOG_DIR/${SERVER_NAME}.out &
+if [ "X${RUN_IN_FOREGROUND}" == "Xtrue" ]; then
+
+  echo  "java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1"
+  java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1
 
-pid=$!
-sleep 2
-if [[ -z "${pid}" ]]; then
-    echo "server $SERVER_NAME start failed!"
-    exit 1
 else
-    echo "server $SERVER_NAME start succeeded!"
-    echo $pid > $SERVER_PID
-fi
+
+  echo  "nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &"
+  nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 >  $LINKIS_LOG_DIR/${SERVER_NAME}.out &
+
+  pid=$!
+  sleep 2
+  if [[ -z "${pid}" ]]; then
+      echo "server $SERVER_NAME start failed!"
+      exit 1
+  else
+      echo "server $SERVER_NAME start succeeded!"
+      echo $pid > $SERVER_PID
+
+      if [ "X${RUN_IN_FOREGROUND}" == "Xtrue" ]; then
+        wait $pid || exit -1
+      fi
+  fi
+
+fi

Review Comment:
   empty line is needed



##########
web/pom.xml:
##########
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>linkis</artifactId>
+    <groupId>org.apache.linkis</groupId>
+    <version>1.1.3</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>linkis-web</artifactId>
+  <packaging>pom</packaging>
+
+  <profiles>
+    <profile>
+      <id>web</id>
+      <activation>
+        <property>
+          <name>linkis.build.web</name>
+          <value>true</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>build</id>
+                <phase>install</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <target>
+                    <exec executable="npm" failonerror="true">
+                      <arg value="run" />
+                      <arg value="build" />
+                    </exec>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+</project>

Review Comment:
   empty line in the end is needed.



##########
linkis-dist/docker/Dockerfile:
##########
@@ -0,0 +1,99 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+######################################################################
+# linkis image
+######################################################################
+
+ARG IMAGE_BASE=centos:7
+ARG IMAGE_BASE_WEB=nginx:1.19.6
+
+FROM ${IMAGE_BASE} as linkis
+
+ARG BUILD_TYPE=dev
+
+ARG JDK_VERSION=1.8.0-openjdk
+ARG JDK_BUILD_REVISION=1.8.0.332.b09-1.el7_9
+
+ARG MYSQL_JDBC_VERSION=5.1.49
+
+ARG LINKIS_VERSION=0.0.0
+ARG LINKIS_SYSTEM_USER="hadoop"
+ARG LINKIS_SYSTEM_UID="9001"
+
+ARG LINKIS_HOME=/opt/linkis
+ARG LINKIS_CONF_DIR=/etc/linkis-conf
+ARG LINKIS_LOG_DIR=/var/logs/linkis
+
+WORKDIR ${LINKIS_HOME}
+
+RUN useradd -r -s /bin/bash -u ${LINKIS_SYSTEM_UID} -g root -G wheel ${LINKIS_SYSTEM_USER}
+
+# TODO: remove install mysql client when schema-init-tools is ready
+RUN yum install -y \
+       vim unzip curl sudo krb5-workstation sssd crontabs python-pip \
+       java-${JDK_VERSION}-${JDK_BUILD_REVISION} \
+       java-${JDK_VERSION}-devel-${JDK_BUILD_REVISION} \
+       mysql \
+    && yum clean all
+
+RUN sed -i "s#^%wheel.*#%wheel        ALL=(ALL)       NOPASSWD: ALL#g" /etc/sudoers
+
+RUN mkdir -p /opt/tmp \
+    && mkdir -p ${LINKIS_CONF_DIR} \
+    && mkdir -p ${LINKIS_LOG_DIR}
+
+ENV JAVA_HOME /etc/alternatives/jre
+ENV LINKIS_CONF_DIR ${LINKIS_CONF_DIR}
+ENV LINKIS_CLIENT_CONF_DIR ${LINKIS_CONF_DIR}
+ENV LINKIS_HOME ${LINKIS_HOME}
+
+ADD apache-linkis-${LINKIS_VERSION}-incubating-bin.tar.gz /opt/tmp/
+
+# Put mysql-connector-java-*.jar package into the image only in development mode
+RUN if [ "$BUILD_TYPE" = "dev" ] ; then \
+      curl -L -o /opt/tmp/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar \
+        https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_JDBC_VERSION}/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar; \

Review Comment:
   remind: The mysql driver jar file does not follow the Apache License, the github action to build the image automatically should set the ARG not to be "dev"



##########
linkis-dist/package/sbin/ext/linkis-common-start:
##########
@@ -73,15 +73,25 @@ fi
 export SERVER_CLASS_PATH=$SERVER_CONF_PATH:$LINKIS_COMMONS_LIB/*:$SERVER_LIB/*
 
 echo  "=====Java Start Command====="
-echo  "nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &"
-nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &
 
-pid=$!
-sleep 2
-if [[ -z "${pid}" ]]; then
-    echo "server $SERVER_NAME start failed!"
-    exit 1
+if [ "X${RUN_IN_FOREGROUND}" == "Xtrue" ]; then
+
+  echo  "java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1"
+  java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1
+
 else
-    echo "server $SERVER_NAME start succeeded!"
-    echo $pid > $SERVER_PID
-fi
\ No newline at end of file
+
+  echo  "nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &"
+  nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &
+
+  pid=$!
+  sleep 2
+  if [[ -z "${pid}" ]]; then
+      echo "server $SERVER_NAME start failed!"
+      exit 1
+  else
+      echo "server $SERVER_NAME start succeeded!"
+      echo $pid > $SERVER_PID
+  fi
+
+fi

Review Comment:
   add an empty line



##########
linkis-dist/pom.xml:
##########
@@ -218,4 +218,87 @@
         </plugins>
     </build>
 
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <properties>
+                <image.build.type>dev</image.build.type>
+                <image.base>centos:7</image.base>
+                <image.base.web>nginx:1.19.6</image.base.web>
+                <jdk.version>1.8.0-openjdk</jdk.version>
+                <jdk.build.revision>1.8.0.332.b09-1.el7_9</jdk.build.revision>
+                <linkis.system.user>hadoop</linkis.system.user>
+                <linkis.system.uid>9001</linkis.system.uid>
+                <linkis.home>/opt/linkis</linkis.home>
+                <linkis.conf.dir>/etc/linkis-conf</linkis.conf.dir>
+                <linkis.log.dir>/var/logs/linkis</linkis.log.dir>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>build-linkis-image</id>
+                                <phase>install</phase>

Review Comment:
   I think the image build should not be include in the 'install' phase automatically, we can add some doc in project `https://github.com/apache/incubator-linkis-website`



##########
linkis-dist/pom.xml:
##########
@@ -218,4 +218,87 @@
         </plugins>
     </build>
 
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <properties>
+                <image.build.type>dev</image.build.type>
+                <image.base>centos:7</image.base>
+                <image.base.web>nginx:1.19.6</image.base.web>
+                <jdk.version>1.8.0-openjdk</jdk.version>
+                <jdk.build.revision>1.8.0.332.b09-1.el7_9</jdk.build.revision>
+                <linkis.system.user>hadoop</linkis.system.user>
+                <linkis.system.uid>9001</linkis.system.uid>
+                <linkis.home>/opt/linkis</linkis.home>
+                <linkis.conf.dir>/etc/linkis-conf</linkis.conf.dir>
+                <linkis.log.dir>/var/logs/linkis</linkis.log.dir>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>build-linkis-image</id>
+                                <phase>install</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <target name="linkis-image">
+                                        <exec executable="docker" failonerror="true" >
+                                            <arg value="build" />
+                                            <arg value="-f"          /> <arg value="${project.basedir}/docker/Dockerfile" />
+                                            <arg value="-t"          /> <arg value="${project.parent.artifactId}:${project.version}" />
+                                            <arg value="--target"    /> <arg value="linkis" />
+                                            <arg value="--build-arg" /> <arg value="IMAGE_BASE=${image.base}" />
+                                            <arg value="--build-arg" /> <arg value="JDK_VERSION=${jdk.version}" />
+                                            <arg value="--build-arg" /> <arg value="JDK_BUILD_REVISION=${jdk.build.revision}" />
+                                            <arg value="--build-arg" /> <arg value="LINKIS_VERSION=${project.version}" />
+                                            <arg value="--build-arg" /> <arg value="MYSQL_JDBC_VERSION=${mysql.connector.version}" />
+                                            <arg value="--build-arg" /> <arg value="BUILD_TYPE=${image.build.type}" />
+                                            <arg value="--build-arg" /> <arg value="LINKIS_SYSTEM_USER=${linkis.system.user}" />
+                                            <arg value="--build-arg" /> <arg value="LINKIS_SYSTEM_UID=${linkis.system.uid}" />
+                                            <arg value="--build-arg" /> <arg value="LINKIS_HOME=${linkis.home}" />
+                                            <arg value="--build-arg" /> <arg value="LINKIS_CONF_DIR=${linkis.conf.dir}" />
+                                            <arg value="--build-arg" /> <arg value="LINKIS_LOG_DIR=${linkis.log.dir}" />
+                                            <arg value="${project.build.directory}" />
+                                        </exec>
+                                    </target>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>build-linkis-web-image</id>
+                                <phase>install</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <target name="linkis-web-image" if="linkis.build.web">
+                                        <echo message="Building linkis web image ..." />
+                                        <mkdir dir="${basedir}/target/apache-linkis-web-${project.version}-dist" />
+                                        <copy todir="${basedir}/target/apache-linkis-web-${project.version}-dist">
+                                            <fileset dir="${basedir}/../web/dist" includes="**" />
+                                        </copy>
+                                        <exec executable="docker" failonerror="true" >
+                                            <arg value="build" />
+                                            <arg value="-f"          /> <arg value="${project.basedir}/docker/Dockerfile" />
+                                            <arg value="-t"          /> <arg value="${project.parent.artifactId}-web:${project.version}" />
+                                            <arg value="--target"    /> <arg value="linkis-web" />
+                                            <arg value="--build-arg" /> <arg value="IMAGE_BASE_WEB=${image.base.web}" />
+                                            <arg value="--build-arg" /> <arg value="LINKIS_VERSION=${project.version}" />
+                                            <arg value="--build-arg" /> <arg value="LINKIS_HOME=${linkis.home}" />
+                                            <arg value="${project.build.directory}" />
+                                        </exec>
+                                    </target>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>

Review Comment:
   Emmm, this seems to be a legacy code, but would you help add an empty line in the end of the file. Thanks.



##########
linkis-dist/docker/Dockerfile:
##########
@@ -0,0 +1,99 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+######################################################################
+# linkis image
+######################################################################
+
+ARG IMAGE_BASE=centos:7
+ARG IMAGE_BASE_WEB=nginx:1.19.6
+
+FROM ${IMAGE_BASE} as linkis
+
+ARG BUILD_TYPE=dev
+
+ARG JDK_VERSION=1.8.0-openjdk
+ARG JDK_BUILD_REVISION=1.8.0.332.b09-1.el7_9
+
+ARG MYSQL_JDBC_VERSION=5.1.49
+
+ARG LINKIS_VERSION=0.0.0
+ARG LINKIS_SYSTEM_USER="hadoop"
+ARG LINKIS_SYSTEM_UID="9001"
+
+ARG LINKIS_HOME=/opt/linkis
+ARG LINKIS_CONF_DIR=/etc/linkis-conf
+ARG LINKIS_LOG_DIR=/var/logs/linkis
+
+WORKDIR ${LINKIS_HOME}
+
+RUN useradd -r -s /bin/bash -u ${LINKIS_SYSTEM_UID} -g root -G wheel ${LINKIS_SYSTEM_USER}
+
+# TODO: remove install mysql client when schema-init-tools is ready
+RUN yum install -y \
+       vim unzip curl sudo krb5-workstation sssd crontabs python-pip \
+       java-${JDK_VERSION}-${JDK_BUILD_REVISION} \
+       java-${JDK_VERSION}-devel-${JDK_BUILD_REVISION} \
+       mysql \
+    && yum clean all
+
+RUN sed -i "s#^%wheel.*#%wheel        ALL=(ALL)       NOPASSWD: ALL#g" /etc/sudoers
+
+RUN mkdir -p /opt/tmp \
+    && mkdir -p ${LINKIS_CONF_DIR} \
+    && mkdir -p ${LINKIS_LOG_DIR}
+
+ENV JAVA_HOME /etc/alternatives/jre
+ENV LINKIS_CONF_DIR ${LINKIS_CONF_DIR}
+ENV LINKIS_CLIENT_CONF_DIR ${LINKIS_CONF_DIR}
+ENV LINKIS_HOME ${LINKIS_HOME}
+
+ADD apache-linkis-${LINKIS_VERSION}-incubating-bin.tar.gz /opt/tmp/
+
+# Put mysql-connector-java-*.jar package into the image only in development mode
+RUN if [ "$BUILD_TYPE" = "dev" ] ; then \
+      curl -L -o /opt/tmp/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar \
+        https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_JDBC_VERSION}/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar; \
+    fi
+
+RUN mv /opt/tmp/linkis-package/* ${LINKIS_HOME}/ \
+    && cp /opt/tmp/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar ${LINKIS_HOME}/lib/linkis-commons/public-module/ \
+    && cp /opt/tmp/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar ${LINKIS_HOME}/lib/linkis-spring-cloud-services/linkis-mg-gateway/ \

Review Comment:
   If not in "dev" BUILD_TYPE, the `/opt/tmp/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar` would not exist, this would cause docker building to fail. We need to take this into consideration.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org


[GitHub] [incubator-linkis] AaronLinOops commented on a diff in pull request #2447: [Feature] Add Dockerfile to linkis-dist module for both linkis backends and web

Posted by GitBox <gi...@apache.org>.
AaronLinOops commented on code in PR #2447:
URL: https://github.com/apache/incubator-linkis/pull/2447#discussion_r919612951


##########
web/pom.xml:
##########
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>linkis</artifactId>
+    <groupId>org.apache.linkis</groupId>
+    <version>1.1.3</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>linkis-web</artifactId>
+  <packaging>pom</packaging>
+
+  <profiles>
+    <profile>
+      <id>web</id>
+      <activation>
+        <property>
+          <name>linkis.build.web</name>
+          <value>true</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>build</id>
+                <phase>install</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <target>
+                    <exec executable="npm" failonerror="true">
+                      <arg value="run" />
+                      <arg value="build" />
+                    </exec>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+</project>

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org


[GitHub] [incubator-linkis] legendtkl merged pull request #2447: [Feature] Add Dockerfile to linkis-dist module for both linkis backends and web

Posted by GitBox <gi...@apache.org>.
legendtkl merged PR #2447:
URL: https://github.com/apache/incubator-linkis/pull/2447


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org


[GitHub] [incubator-linkis] AaronLinOops commented on a diff in pull request #2447: [Feature] Add Dockerfile to linkis-dist module for both linkis backends and web

Posted by GitBox <gi...@apache.org>.
AaronLinOops commented on code in PR #2447:
URL: https://github.com/apache/incubator-linkis/pull/2447#discussion_r919612796


##########
linkis-dist/pom.xml:
##########
@@ -218,4 +218,87 @@
         </plugins>
     </build>
 
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <properties>
+                <image.build.type>dev</image.build.type>
+                <image.base>centos:7</image.base>
+                <image.base.web>nginx:1.19.6</image.base.web>
+                <jdk.version>1.8.0-openjdk</jdk.version>
+                <jdk.build.revision>1.8.0.332.b09-1.el7_9</jdk.build.revision>
+                <linkis.system.user>hadoop</linkis.system.user>
+                <linkis.system.uid>9001</linkis.system.uid>
+                <linkis.home>/opt/linkis</linkis.home>
+                <linkis.conf.dir>/etc/linkis-conf</linkis.conf.dir>
+                <linkis.log.dir>/var/logs/linkis</linkis.log.dir>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>build-linkis-image</id>
+                                <phase>install</phase>

Review Comment:
   has add some doc in the README.md, use the -Pdocker to enable the process. I will add a detail doc in incubator-linkis-website in later PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org


[GitHub] [incubator-linkis] AaronLinOops commented on a diff in pull request #2447: [Feature] Add Dockerfile to linkis-dist module for both linkis backends and web

Posted by GitBox <gi...@apache.org>.
AaronLinOops commented on code in PR #2447:
URL: https://github.com/apache/incubator-linkis/pull/2447#discussion_r919612024


##########
linkis-dist/docker/Dockerfile:
##########
@@ -0,0 +1,99 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+######################################################################
+# linkis image
+######################################################################
+
+ARG IMAGE_BASE=centos:7
+ARG IMAGE_BASE_WEB=nginx:1.19.6
+
+FROM ${IMAGE_BASE} as linkis
+
+ARG BUILD_TYPE=dev
+
+ARG JDK_VERSION=1.8.0-openjdk
+ARG JDK_BUILD_REVISION=1.8.0.332.b09-1.el7_9
+
+ARG MYSQL_JDBC_VERSION=5.1.49
+
+ARG LINKIS_VERSION=0.0.0
+ARG LINKIS_SYSTEM_USER="hadoop"
+ARG LINKIS_SYSTEM_UID="9001"
+
+ARG LINKIS_HOME=/opt/linkis
+ARG LINKIS_CONF_DIR=/etc/linkis-conf
+ARG LINKIS_LOG_DIR=/var/logs/linkis
+
+WORKDIR ${LINKIS_HOME}
+
+RUN useradd -r -s /bin/bash -u ${LINKIS_SYSTEM_UID} -g root -G wheel ${LINKIS_SYSTEM_USER}
+
+# TODO: remove install mysql client when schema-init-tools is ready
+RUN yum install -y \
+       vim unzip curl sudo krb5-workstation sssd crontabs python-pip \
+       java-${JDK_VERSION}-${JDK_BUILD_REVISION} \
+       java-${JDK_VERSION}-devel-${JDK_BUILD_REVISION} \
+       mysql \
+    && yum clean all
+
+RUN sed -i "s#^%wheel.*#%wheel        ALL=(ALL)       NOPASSWD: ALL#g" /etc/sudoers
+
+RUN mkdir -p /opt/tmp \
+    && mkdir -p ${LINKIS_CONF_DIR} \
+    && mkdir -p ${LINKIS_LOG_DIR}
+
+ENV JAVA_HOME /etc/alternatives/jre
+ENV LINKIS_CONF_DIR ${LINKIS_CONF_DIR}
+ENV LINKIS_CLIENT_CONF_DIR ${LINKIS_CONF_DIR}
+ENV LINKIS_HOME ${LINKIS_HOME}
+
+ADD apache-linkis-${LINKIS_VERSION}-incubating-bin.tar.gz /opt/tmp/
+
+# Put mysql-connector-java-*.jar package into the image only in development mode
+RUN if [ "$BUILD_TYPE" = "dev" ] ; then \
+      curl -L -o /opt/tmp/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar \
+        https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_JDBC_VERSION}/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar; \
+    fi
+
+RUN mv /opt/tmp/linkis-package/* ${LINKIS_HOME}/ \
+    && cp /opt/tmp/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar ${LINKIS_HOME}/lib/linkis-commons/public-module/ \
+    && cp /opt/tmp/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar ${LINKIS_HOME}/lib/linkis-spring-cloud-services/linkis-mg-gateway/ \

Review Comment:
   right



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org


[GitHub] [incubator-linkis] AaronLinOops commented on a diff in pull request #2447: [Feature] Add Dockerfile to linkis-dist module for both linkis backends and web

Posted by GitBox <gi...@apache.org>.
AaronLinOops commented on code in PR #2447:
URL: https://github.com/apache/incubator-linkis/pull/2447#discussion_r919611850


##########
linkis-dist/docker/Dockerfile:
##########
@@ -0,0 +1,99 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+######################################################################
+# linkis image
+######################################################################
+
+ARG IMAGE_BASE=centos:7
+ARG IMAGE_BASE_WEB=nginx:1.19.6
+
+FROM ${IMAGE_BASE} as linkis
+
+ARG BUILD_TYPE=dev
+
+ARG JDK_VERSION=1.8.0-openjdk
+ARG JDK_BUILD_REVISION=1.8.0.332.b09-1.el7_9
+
+ARG MYSQL_JDBC_VERSION=5.1.49
+
+ARG LINKIS_VERSION=0.0.0
+ARG LINKIS_SYSTEM_USER="hadoop"
+ARG LINKIS_SYSTEM_UID="9001"
+
+ARG LINKIS_HOME=/opt/linkis
+ARG LINKIS_CONF_DIR=/etc/linkis-conf
+ARG LINKIS_LOG_DIR=/var/logs/linkis
+
+WORKDIR ${LINKIS_HOME}
+
+RUN useradd -r -s /bin/bash -u ${LINKIS_SYSTEM_UID} -g root -G wheel ${LINKIS_SYSTEM_USER}
+
+# TODO: remove install mysql client when schema-init-tools is ready
+RUN yum install -y \
+       vim unzip curl sudo krb5-workstation sssd crontabs python-pip \
+       java-${JDK_VERSION}-${JDK_BUILD_REVISION} \
+       java-${JDK_VERSION}-devel-${JDK_BUILD_REVISION} \
+       mysql \
+    && yum clean all
+
+RUN sed -i "s#^%wheel.*#%wheel        ALL=(ALL)       NOPASSWD: ALL#g" /etc/sudoers
+
+RUN mkdir -p /opt/tmp \
+    && mkdir -p ${LINKIS_CONF_DIR} \
+    && mkdir -p ${LINKIS_LOG_DIR}
+
+ENV JAVA_HOME /etc/alternatives/jre
+ENV LINKIS_CONF_DIR ${LINKIS_CONF_DIR}
+ENV LINKIS_CLIENT_CONF_DIR ${LINKIS_CONF_DIR}
+ENV LINKIS_HOME ${LINKIS_HOME}
+
+ADD apache-linkis-${LINKIS_VERSION}-incubating-bin.tar.gz /opt/tmp/
+
+# Put mysql-connector-java-*.jar package into the image only in development mode
+RUN if [ "$BUILD_TYPE" = "dev" ] ; then \
+      curl -L -o /opt/tmp/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar \
+        https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_JDBC_VERSION}/mysql-connector-java-${MYSQL_JDBC_VERSION}.jar; \

Review Comment:
   good catch



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org