You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mnemonic.apache.org by ga...@apache.org on 2023/05/26 20:30:47 UTC

[mnemonic] branch master updated: MNEMONIC-777 Add a dev container configuration for vscode

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

garyw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mnemonic.git


The following commit(s) were added to refs/heads/master by this push:
     new e834c0a  MNEMONIC-777 Add a dev container configuration for vscode
e834c0a is described below

commit e834c0a135831c6561c61e7e9e92fca0918b3e7c
Author: lcy0816 <lc...@hotmail.com>
AuthorDate: Mon May 22 16:43:47 2023 -0700

    MNEMONIC-777 Add a dev container configuration for vscode
    
    Signed-off-by: lcy0816 <lc...@hotmail.com>
---
 .devcontainer/Dockerfile                      | 52 +++++++++++++++++++++++++++
 .devcontainer/devcontainer.json               | 22 +++---------
 .devcontainer/docker-compose.devcontainer.yml | 23 ++++++++++++
 .gitignore                                    |  4 ++-
 4 files changed, 83 insertions(+), 18 deletions(-)

diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 0000000..4c0e181
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,52 @@
+#
+# 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.
+#
+
+FROM ubuntu:22.04
+LABEL maintainer="Yanhui Zhao (yanhui.zhao@outlook.com)"
+
+RUN apt-get -y update && apt-get install -y software-properties-common && add-apt-repository ppa:openjdk-r/ppa && apt-get -y update && \
+    apt-get install -y openjdk-17-jdk cmake check git pkg-config autoconf man build-essential gcc g++ uuid-dev pandoc devscripts flex doxygen maven
+
+RUN apt-get install -y libndctl-dev libpmem-dev libpmemobj-dev libmemkind-dev
+
+RUN apt-get clean
+
+WORKDIR /ws
+
+RUN git clone https://github.com/pmem/vmem && \
+    cd vmem && make && make install
+
+RUN cd /ws
+
+RUN git clone https://github.com/redis/hiredis.git && \
+	cd hiredis && make && make install
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
+
+ENV PATH="/root/.cargo/bin:${PATH}"
+
+RUN cd /ws
+
+ENV MNEMONIC_HOME /ws/mnemonic
+
+#RUN cd /ws/mnemonic && tools/runall.sh -y
+
+SHELL ["/bin/bash", "-c"]
+RUN fp=$(readlink -e $(which javac)); echo "export JAVA_HOME=${fp/%\/bin\/javac/}" >> ~/.bashrc
+RUN echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> ~/.bashrc
+
+CMD ["bash"]
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 42c53f8..e6e21d0 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -16,21 +16,9 @@
 // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
 // https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/ubuntu
 {
-	"image": "mnemonic/mneci:v6",
-
-	// Set *default* container specific settings.json values on container create.
-	"settings": {},
-
-
-	// Add the IDs of extensions you want installed when the container is created.
-	"extensions": []
-
-	// Use 'forwardPorts' to make a list of ports inside the container available locally.
-	// "forwardPorts": [],
-
-	// Use 'postCreateCommand' to run commands after the container is created.
-	// "postCreateCommand": "uname -a",
-
-	// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
-    // "remoteUser": "vscode",
+	"name": "apache mnemonic",
+	"dockerComposeFile": "docker-compose.devcontainer.yml",
+	"service": "mnemonic",
+	"workspaceFolder": "/ws/mnemonic",
+	"shutdownAction": "stopCompose"
 }
diff --git a/.devcontainer/docker-compose.devcontainer.yml b/.devcontainer/docker-compose.devcontainer.yml
new file mode 100644
index 0000000..3581407
--- /dev/null
+++ b/.devcontainer/docker-compose.devcontainer.yml
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+services:
+  mnemonic:
+    build: .
+    command: /bin/sh -c "while sleep 1000; do :; done"
+    volumes:
+      - ..:/ws/mnemonic:cached
diff --git a/.gitignore b/.gitignore
index 5ba25d9..d56b389 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,7 +13,9 @@ target/
 *.war
 *.ear
 hs_err_pid*
-/build/
+**/build/
+**/CMakeFiles/
+*.cmake
 gradle-app.setting
 gradle.properties
 !gradle-wrapper.jar