This is an automated email from the ASF dual-hosted git repository.

weibin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-graphar.git


The following commit(s) were added to refs/heads/main by this push:
     new ff58d7f  feat(devinfra): Improve dev container image and add related 
Dockerfile (#503)
ff58d7f is described below

commit ff58d7f2b3b193a336a875dc66f12153e8de6a26
Author: Weibin Zeng <[email protected]>
AuthorDate: Fri May 31 09:58:02 2024 +0800

    feat(devinfra): Improve dev container image and add related Dockerfile 
(#503)
    
    
    
    ---------
    
    Signed-off-by: acezen <[email protected]>
---
 .devcontainer/devcontainer.json      | 39 +---------------------------
 .devcontainer/graphar-dev.Dockerfile | 49 ++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 38 deletions(-)

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 00c5a76..8c416b5 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -48,42 +48,5 @@
        },
 
        // Set `remoteUser` to `root` to connect as root instead. More info: 
https://aka.ms/vscode-remote/containers/non-root.
-       "remoteUser": "graphar",
-
-       // Use 'postCreateCommand' to run commands before the container is 
created.
-       "initializeCommand": "sudo docker pull graphar/graphar-dev:latest",
-
-       // Uncomment this to enable C++ and Rust debugging in containers
-       // "capAdd": ["SYS_PTRACE"],
-       // "securityOpt": ["seccomp=unconfined"],
-
-       // Use 'forwardPorts' to make a list of ports inside the container 
available locally.
-       // "forwardPorts": [3000],
-
-       // Use 'portsAttributes' to set default properties for specific 
forwarded ports.
-       // More info: 
https://containers.dev/implementors/json_reference/#port-attributes
-       // "portsAttributes": {
-       //      "9000": {
-       //              "label": "Hello Remote World",
-       //              "onAutoForward": "notify"
-       //      }
-       // },
-
-       // Use 'postCreateCommand' to run commands after the container is 
created.
-       // "postCreateCommand": "yarn install"
-
-       // Improve performance
-
-       // Uncomment these to mount a folder to a volume
-       // 
https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-a-targeted-named-volume
-       // "mounts": [
-    //         
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume"
-       // ],
-
-
-       // Uncomment these to use a named volume for your entire source tree
-       // 
https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-a-named-volume-for-your-entire-source-tree
-       // "workspaceMount": "source=gs,target=/workspaces,type=volume",
-       // "workspaceFolder": "/workspaces"
-       "postCreateCommand": "sudo chown -R graphar /workspaces && bash 
pre-commit/install-hook.sh && bash pre-commit/prepare-commit-msg"
+       "remoteUser": "graphar"
 }
diff --git a/.devcontainer/graphar-dev.Dockerfile 
b/.devcontainer/graphar-dev.Dockerfile
new file mode 100644
index 0000000..2bdd07a
--- /dev/null
+++ b/.devcontainer/graphar-dev.Dockerfile
@@ -0,0 +1,49 @@
+FROM ubuntu:22.04
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+# shanghai zoneinfo
+ENV TZ=Asia/Shanghai
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
+    echo '$TZ' > /etc/timezone
+
+RUN apt-get update && apt-get install -y ca-certificates lsb-release wget \
+    && wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id 
--short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release 
--codename --short).deb \
+    && apt-get install -y ./apache-arrow-apt-source-latest-$(lsb_release 
--codename --short).deb \
+    && apt-get update \
+    && apt-get install -y \
+       cmake \
+       build-essential \
+       libarrow-dev \
+       libarrow-dataset-dev \
+       libarrow-acero-dev \
+       libparquet-dev \
+       libboost-graph-dev \
+       doxygen \
+       npm \
+       default-jdk \
+       git \
+       vim \
+       sudo \
+       tzdata \
+       maven \
+    && curl -sSL https://install.python-poetry.org | python3 - \
+    && wget 
https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-22538c65/clang-format-8_linux-amd64
 -O /usr/bin/clang-format \
+    && chmod +x /usr/bin/clang-format \
+    && apt-get clean -y \
+    && rm -rf /var/lib/apt/lists/* 
./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
+
+RUN git clone --branch v1.8.3 https://github.com/google/benchmark.git 
/tmp/benchmark --depth 1 \
+    && cd /tmp/benchmark \
+    && cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_TESTING=OFF 
-DBENCHMARK_ENABLE_GTEST_TESTS=OFF . \
+    && make -j`nproc` \
+    && make install \
+    && rm -rf /tmp/benchmark
+
+ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64
+ENV JAVA_HOME=/usr/lib/jvm/default-java
+
+RUN useradd -m graphar -u 1001 \
+    && echo 'graphar ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
+USER graphar
+WORKDIR /home/graphar


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to