From 994b6f61f532816add001c4f768dff82e760a9b7 Mon Sep 17 00:00:00 2001 From: Davide De Tommaso Date: Fri, 12 Jan 2024 15:37:50 +0100 Subject: [PATCH] Integrated pyicub-frontend v8.0 --- .dockyman/Makefile | 2 +- .dockyman/profiles/local.yaml | 2 ++ README.md | 10 +++++++++ base/pyicub-frontend/.devcontainer.json | 3 +-- base/pyicub-frontend/Dockerfile | 29 +++++++------------------ build.env | 4 ++-- compose.base.yaml | 2 +- compose.local.yaml | 1 + compose.yaml | 2 ++ 9 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.dockyman/Makefile b/.dockyman/Makefile index cde91d3..97e2b5c 100644 --- a/.dockyman/Makefile +++ b/.dockyman/Makefile @@ -58,7 +58,7 @@ ifeq ($(UNAME), Linux) ifeq ($(shell lsb_release -is), Ubuntu) PACKAGE_MANAGER := apt-get DOCKER_INSTALL_CMD := curl -fsSL https://get.docker.com | sh - DOCKER_COMPOSE_INSTALL_CMD := sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(shell uname -s)-$(shell uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose + DOCKER_COMPOSE_INSTALL_CMD := sudo curl -L "https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-$(shell uname -s)-$(shell uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose NVIDIA_DOCKER_INSTALL_CMD := distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - && curl -s -L https://nvidia.github.io/nvidia-docker/$$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list && sudo apt-get update && sudo apt-get install -y nvidia-docker2 && sudo systemctl restart docker else ifeq ($(shell cat /etc/os-release | grep '^ID=' | cut -d= -f2), centos) PACKAGE_MANAGER := yum diff --git a/.dockyman/profiles/local.yaml b/.dockyman/profiles/local.yaml index 3da3e55..ae4f873 100644 --- a/.dockyman/profiles/local.yaml +++ b/.dockyman/profiles/local.yaml @@ -22,6 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +version: '3.8' + services: local: diff --git a/README.md b/README.md index 4368941..a1f9587 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ ![PYICUB logo](media/pyicublab-logo.png?raw=true) ==== +Requirements +------------ + +- make +- docker + +``` +sudo apt-get install build-essential +``` + Introduction ------------ diff --git a/base/pyicub-frontend/.devcontainer.json b/base/pyicub-frontend/.devcontainer.json index 2cf3aab..96bfce3 100644 --- a/base/pyicub-frontend/.devcontainer.json +++ b/base/pyicub-frontend/.devcontainer.json @@ -2,8 +2,7 @@ "build": { "dockerfile": "Dockerfile", - "args": { "DOCKER_SRC": "${localEnv:DOCKER_SRC}", - "PYICUB_FRONTEND_VERSION": "${localEnv:PYICUB_FRONTEND_VERSION}" } + "args": { "PYICUB_FRONTEND_VERSION": "${localEnv:PYICUB_FRONTEND_VERSION}" } } } \ No newline at end of file diff --git a/base/pyicub-frontend/Dockerfile b/base/pyicub-frontend/Dockerfile index 230d1f1..05ae1d2 100644 --- a/base/pyicub-frontend/Dockerfile +++ b/base/pyicub-frontend/Dockerfile @@ -22,31 +22,18 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -FROM node:16 - +FROM node:21 ARG PYICUB_FRONTEND_VERSION=master - RUN mkdir /app WORKDIR /app - -# Create react app -RUN npx create-react-app pyicub-frontend - -# Define work directory -WORKDIR /app/pyicub-frontend - -RUN npm ci -RUN npm install @mui/material @emotion/react @emotion/styled -RUN npm install bootstrap@3 -RUN npm install react-iframe -RUN npm install react-router-dom@6 -RUN npm i react-icons -RUN npm install http-proxy-middleware --save - -RUN mkdir -p /root/.vscode-server /root/.vscode-server-insiders + RUN git clone https://github.com/s4hri/pyicub-frontend -b master tmp + RUN cd tmp && git checkout ${PYICUB_FRONTEND_VERSION} RUN cp -a tmp/. /app/pyicub-frontend/ RUN rm -rf tmp - -CMD ["npm", "start"] \ No newline at end of file +# Define work directory +WORKDIR /app/pyicub-frontend +RUN npm install + +CMD npm run production -- --port ${PYICUB_API_FRONTEND_PORT} \ No newline at end of file diff --git a/build.env b/build.env index 7bc6fd2..05b5afa 100644 --- a/build.env +++ b/build.env @@ -1,4 +1,4 @@ -DOCKYMAN_VER=v1.0 +DOCKYMAN_VER=v1.1 REPOSITORY=iitschri PROFILE=development @@ -8,7 +8,7 @@ ICUB_DISTRO=v2022.02.0-ubuntu20.04 PYICUB_BASE_DOCKER_SRC=${REPOSITORY}/robotology-superbuild-docker:${ICUB_DISTRO} PYICUB_BASE_NAME=${REPOSITORY}/pyicub-docker:${VERSION} PYICUB_VERSION=${VERSION} -PYICUB_FRONTEND_VERSION=v7.0-distro_${ICUB_DISTRO} +PYICUB_FRONTEND_VERSION=v8.0-distro_${ICUB_DISTRO} PYICUB_FRONTEND_BASE_NAME=${REPOSITORY}/pyicub-frontend-docker:${PYICUB_FRONTEND_VERSION} COMPOSE_PROFILES=restapi diff --git a/compose.base.yaml b/compose.base.yaml index 06c5aaa..c9b82ab 100644 --- a/compose.base.yaml +++ b/compose.base.yaml @@ -22,6 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +version: '3.8' services: @@ -50,7 +51,6 @@ services: service: dockyman environment: - - DOCKER_SRC=${PYICUB_BASE_DOCKER_SRC} - PYICUB_FRONTEND_VERSION=${PYICUB_FRONTEND_VERSION} command: --image_name ${PYICUB_FRONTEND_BASE_NAME:?err} --workspace_folder ./base/pyicub-frontend diff --git a/compose.local.yaml b/compose.local.yaml index 4b9ebf5..1e59734 100644 --- a/compose.local.yaml +++ b/compose.local.yaml @@ -22,6 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +version: '3.8' services: diff --git a/compose.yaml b/compose.yaml index 7bd9754..9559c7f 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,3 +1,5 @@ +version: '3.8' + services: pyicub: