Skip to content

Commit

Permalink
Merge pull request #8 from SonySemiconductorSolutions/feature/0.2.0
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
shu-katakura authored Feb 15, 2023
2 parents 1b9fa89 + 47d4686 commit 3238acf
Show file tree
Hide file tree
Showing 191 changed files with 18,697 additions and 1,430 deletions.
8 changes: 2 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
COPY .devcontainer/dependencies/aitrios-sdk-console-access-lib-python /.devcontainer/dependencies/aitrios-sdk-console-access-lib-python
COPY requirements.txt /tmp/pip-tmp/
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
&& rm -rf /tmp/pip-tmp
&& rm -rf /tmp/pip-tmp && rm -rf /.devcontainer

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
Expand All @@ -20,8 +21,3 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

RUN curl -sSL https://github.com/microsoft/VoTT/archive/refs/tags/v2.2.0.tar.gz -o /tmp/v2.2.0.tar.gz
RUN su vscode -c "cd /home/vscode && tar -zxvf /tmp/v2.2.0.tar.gz && . /usr/local/share/nvm/nvm.sh && cd /home/vscode/VoTT-2.2.0 && nvm install 10.15.1 && nvm use && npm install -g serve@~13.0.4 && npm ci && nvm use default"
COPY .devcontainer/vott/vott.sh /home/vscode/
RUN chown vscode:vscode /home/vscode/vott.sh
18 changes: 18 additions & 0 deletions .devcontainer/cvat/create_superuser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
# Copyright 2022 Sony Semiconductor Solutions Corp. All rights reserved.
#
# Licensed 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.

set -e

docker exec -it cvat_server bash -ic 'python3 ~/manage.py createsuperuser'
50 changes: 50 additions & 0 deletions .devcontainer/cvat/docker-compose.devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# cvat v2.3.0 docker compose configuration for devcontainer with docker in docker

version: '3.3'

services:
cvat_db:
restart: "no"
init: true

cvat_redis:
restart: "no"
init: true

cvat_server:
restart: "no"
init: true
labels:
- traefik.http.routers.cvat.rule=(Host(`${CVAT_HOST:-localhost}`) &&
PathPrefix(`/api/`, `/git/`, `/opencv/`, `/static/`, `/admin`, `/documentation/`, `/django-rq`)) ||
(Host(`127.0.0.1`) && PathPrefix(`/api/`, `/git/`, `/opencv/`, `/static/`, `/admin`, `/documentation/`, `/django-rq`))

cvat_utils:
restart: "no"
init: true

cvat_worker_default:
restart: "no"
init: true

cvat_worker_low:
restart: "no"
init: true

cvat_worker_webhooks:
restart: "no"
init: true

cvat_ui:
restart: "no"
init: true
labels:
- traefik.http.routers.cvat-ui.rule=Host(`${CVAT_HOST:-localhost}`) || Host(`127.0.0.1`)

traefik:
restart: "no"
init: true

cvat_opa:
restart: "no"
init: true
19 changes: 19 additions & 0 deletions .devcontainer/cvat/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
# Copyright 2022 Sony Semiconductor Solutions Corp. All rights reserved.
#
# Licensed 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.

set -e

cd .devcontainer/cvat/cvat/
docker compose -f docker-compose.yml -f ../docker-compose.devcontainer.yml up -d
19 changes: 19 additions & 0 deletions .devcontainer/cvat/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
# Copyright 2022 Sony Semiconductor Solutions Corp. All rights reserved.
#
# Licensed 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.

set -e

cd .devcontainer/cvat/cvat/
docker compose stop
34 changes: 22 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,41 @@
"ms-toolsai.jupyter-keymap",
"ms-vscode.cpptools",
"bierner.markdown-mermaid",
"tomoki1207.pdf"
"tomoki1207.pdf",
"ms-vscode.cpptools"
]
}
},

// For git submodules: https://docs.github.com/ja/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces
"codespaces": {
"repositories": {
"SonySemiconductorSolutions/aitrios-sdk-console-access-lib-python": {
"permissions": {
"contents": "read"
}
}
}
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [6080, 5901],
"forwardPorts": [6080, 5901, 8080],
"portsAttributes": {
"6080": {
"label": "Desktop access",
"onAutoForward": "silent"
},
"5901": {
"label": "VNC TCP port",
"8080": {
"label": "CVAT Web UI",
"onAutoForward": "silent"
}
},

// Use 'initializeCommand' to run commands before the container is created.
"initializeCommand": [".devcontainer/initializeCommand"],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements_frequent_change.txt",
"postCreateCommand": ".devcontainer/postCreateCommand.sh",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"docker-in-docker": "20.10",
"desktop-lite": "latest"
"docker-in-docker": "20.10"
}
}
23 changes: 23 additions & 0 deletions .devcontainer/initializeCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Copyright 2022 Sony Semiconductor Solutions Corp. All rights reserved.
#
# Licensed 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.

set -ex

# checkout git submodules before container creation at starting devcontainer/codespaces only first time.
# (below if statement checking is a workaround of git CVE-2022-24765)
if [[ ! "$(ls -A $PWD/.devcontainer/dependencies/aitrios-sdk-console-access-lib-python)" ]]
then
git submodule update --init --recursive $PWD/.devcontainer/dependencies/aitrios-sdk-console-access-lib-python
fi
26 changes: 26 additions & 0 deletions .devcontainer/initializeCommand.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@rem Copyright 2023 Sony Semiconductor Solutions Corp. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@echo on

@rem checkout git submodules before container creation at starting devcontainer/codespaces only first time.
@rem (below if statement checking is a workaround of git CVE-2022-24765)

SET CMDDIR=%~dp0

SET LIB=%CMDDIR%dependencies\aitrios-sdk-console-access-lib-python

dir /b /a %LIB% | findstr "." >nul && (set EMPTY=0) || (set EMPTY=1)
if %EMPTY% EQU 1 (
git submodule update --init --recursive .devcontainer\dependencies\aitrios-sdk-console-access-lib-python
)
40 changes: 10 additions & 30 deletions .devcontainer/vott/vott.sh → .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,15 @@
# limitations under the License.

set -e
. /usr/local/share/nvm/nvm.sh

DIR="build"

cd /home/vscode/VoTT-2.2.0
nvm use

# build VoTT app
if [ ! -d $DIR ];then
npm run build
fi

# launch the server
serve -s build -l 3000 &

# wait up to 30 seconds for the server to come up
connection=false
start_time=`date +%s`
while [ $(( $(date +%s) - 30 )) -lt $start_time ];
do
if timeout 1 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/3000' > /dev/null 2>&1;then
connection=true
break
fi
done

# when the server is up, start the VoTT app
if "${connection}" > /dev/null 2>&1;then
npm run electron-start
# Download cvat if needed.
CVAT_DIR=".devcontainer/cvat/cvat"
if [ ! -d $CVAT_DIR ]
then
echo "downloading cvat."
cd .devcontainer/cvat/
git clone --depth 1 https://github.com/opencv/cvat -b v2.3.0
echo "downloading cvat completed."
else
echo "Connection timed out."
fi
echo "cvat already downloaded."
fi
22 changes: 22 additions & 0 deletions .devcontainer/wamr-ide/download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
# Copyright 2022 Sony Semiconductor Solutions Corp. All rights reserved.
#
# Licensed 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.

set -e

wget https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamr-lldb-1.1.2-x86_64-ubuntu-20.04.tar.gz -P .devcontainer/wamr-ide/

wget https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamr_ide-1.1.2.tar.gz -P .devcontainer/wamr-ide/

tar -zxvf .devcontainer/wamr-ide/wamr_ide-1.1.2.tar.gz -C /home/vscode/
24 changes: 24 additions & 0 deletions .devcontainer/wamr-ide/install_codespaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# Copyright 2022 Sony Semiconductor Solutions Corp. All rights reserved.
#
# Licensed 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.

set -e

mkdir -p .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04

tar -zxvf .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04.tar.gz -C .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04/

cp -rdf .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04/inst/* ~/.vscode-remote/extensions/wamr.wamride-1.1.2/resource/debug/linux/

rm -rdf .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04
24 changes: 24 additions & 0 deletions .devcontainer/wamr-ide/install_localdevcontainer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# Copyright 2022 Sony Semiconductor Solutions Corp. All rights reserved.
#
# Licensed 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.

set -e

mkdir -p .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04

tar -zxvf .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04.tar.gz -C .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04/

cp -rdf .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04/inst/* /home/vscode/.vscode-server/extensions/wamr.wamride-1.1.2/resource/debug/linux/

rm -rdf .devcontainer/wamr-ide/wamr-lldb-1.1.2-x86_64-ubuntu-20.04
31 changes: 16 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# python
__pycache__/
.ipynb_checkpoints/
.coverage
.pytest_cache

# c/c++
*.o

# documents
.asciidoctor
diag-*.png

# resources
tutorials/4_quantize_model/images/
# python
__pycache__/
.ipynb_checkpoints/
.coverage
.pytest_cache

# c/c++
*.o

# documents
.asciidoctor
diag-*.png

# tutorials setting
tutorials/**/configuration.json

4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule ".devcontainer/dependencies/aitrios-sdk-console-access-lib-python"]
path = .devcontainer/dependencies/aitrios-sdk-console-access-lib-python
url = https://github.com/SonySemiconductorSolutions/aitrios-sdk-console-access-lib-python
branch = develop
Loading

0 comments on commit 3238acf

Please sign in to comment.