Skip to content

Commit

Permalink
Merge pull request #51 from IDEA-Research/dev
Browse files Browse the repository at this point in the history
release: v0.4.0
  • Loading branch information
cefeng06 authored Jul 7, 2023
2 parents f1fba43 + 0230022 commit 8d146db
Show file tree
Hide file tree
Showing 62 changed files with 1,327 additions and 770 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
.commitlintrc

# for local cache
op
data
dist
docs
node_modules
deepdataspace.egg-info
23 changes: 5 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,13 @@ RUN npm install -g [email protected] && \
pnpm install --frozen-lockfile && \
pnpm run build:app

FROM deepdataspace/python:3.8 AS dds-builder
FROM python:3.10

WORKDIR /dds/source
COPY . ./
COPY --from=frontend-builder /frontend/packages/app/dist ./deepdataspace/server/static
COPY --from=frontend-builder /frontend/packages/app/dist/index.html ./deepdataspace/server/templates/index.html
RUN python3 setup.py sdist && \
cd /dds/source/dist/ && \
mv deepdataspace*.tar.gz deepdataspace.tar.gz

FROM deepdataspace/python:3.8
RUN mkdir -p /dds/runtime && \
mkdir -p /dds/datasets && \
rm -rf /root/.config/pip

WORKDIR /dds
COPY --from=dds-builder /dds/source/dist/deepdataspace.tar.gz /tmp/deepdataspace.tar.gz
RUN cd /tmp && \
pip3 install deepdataspace.tar.gz && \
pip cache purge

ENV PYTHONUNBUFFERED=1 DDS_IN_DOCKER=1
ADD Dockerfile /root/dds.Dockerfile
RUN mkdir /dds/datasets && \
mkdir /dds/samples && \
python3 -m pip install -r requirements.txt && \
python3 -m pip cache purge
46 changes: 10 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ DeepDataSpace(DDS) requires **Python 3.8 - 3.10** and runs on the following plat
- Mac OS: ✅ x86/x64, ✅ arm64
- Windows 10: ✅ x86/x64, ❌ arm64
- Ubuntu LTS since 18.04: ✅ x86/x64, ❌ arm64
- Docker: ✅ x86/x64, arm64
- Docker Compose: ✅ x86/x64, arm64

### 1.2 Installing from PyPI

Expand Down Expand Up @@ -108,52 +108,26 @@ After the installation, you can start DDS the same way as above:
dds --quickstart
```

### 3.2 Installing from Docker Image
#### Step 1: Preparation
### 3.2 Installing by Docker Compose

```shell
# pull the latest docker image
docker pull deepdataspace/dds
# clone the source code
git clone https://github.com/IDEA-Research/deepdataspace.git

# create a docker volume for dds to persistent data
docker volume create dds-runtime
# prepare dataset directory(where you put all your datasets inside)
mkdir -p datasets
export DDS_DATASET_DIR=$PWD/datasets

# choose a visiting port for DDS
export DDS_PORT=8765
```

#### Step 2: Start DDS in quickstart mode

```shell
# start the DDS in quickstart mode
# DDS will download some sample datasets and import them
docker run -it --name dds --rm \
-p $DDS_PORT:8765 \
-v dds-runtime:/dds/runtime \
deepdataspace/dds \
dds --quickstart -V
# start DDS with docker compose
cd deepdataspace
docker compose up
```

If everything goes well, you can start visiting DDS at [http://127.0.0.1:8765](http://127.0.0.1:8765)

#### Step 3: Mount your dataset directory(**Optional**)

If you start DDS in `quickstart` mode, DDS will try to download the sample datasets and import them for you.
But most frequently, you want DDS to import your local dataset files. This is possible by mounting your local dataset directory to `/dds/datasets` inside container.

```
# assume $PWD/datasets is your local dataset directory
mkdir -p datasets
# start the container without quickstart mode
docker run -it --name dds --rm \
-p 54321:8765 \
-v dds-runtime:/dds/runtime \
-v $PWD/datasets:/dds/datasets:ro \
deepdataspace/dds \
dds -V
```

## 4. Documentation

Visit our [documentation](https://docs.deepdataspace.com) for more details on how to utilize the powers of DDS.
Expand Down
29 changes: 1 addition & 28 deletions deepdataspace/scripts/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,5 @@
help="Load the target yaml file to initialize more configurations. "
"The command line options take precedence of the config file.")
def start_dds(data_dir, quickstart, verbose, public, host, port, reload, configfile):
in_docker = os.environ.get("DDS_IN_DOCKER", None)
runtime_dir = None
if bool(in_docker):
runtime_dir = "/dds/runtime"
os.makedirs(runtime_dir, exist_ok=True)
print(f"DDS is running in docker, runtime_dir is forced to {runtime_dir}")

data_dir = "/dds/datasets"
os.makedirs(data_dir, exist_ok=True)
print(f"DDS is running in docker, data_dir is forced to {data_dir}")

host = "0.0.0.0"
print(f"DDS is running in docker, host is forced to {host}")

port = 8765
print(f"DDS is running in docker, port is forced to {port}")

verbose = True
print(f"DDS is running in docker, verbose is forced to {verbose}")

reload = False
print(f"DDS is running in docker, reload is forced to {reload}")

configfile = None
print(f"DDS is running in docker, configfile is forced to {configfile}")

dds = DDS(data_dir, quickstart, verbose, public, host, port, reload, configfile,
runtime_dir=runtime_dir, from_cmdline=True)
dds = DDS(data_dir, quickstart, verbose, public, host, port, reload, configfile, from_cmdline=True)
dds.start()
1 change: 1 addition & 0 deletions deepdataspace/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
},
}
}

if is_local:
LOGGING["handlers"]["django"] = {
"level" : "INFO",
Expand Down
Binary file removed deepdataspace/server/static/000000002299.jpg
Binary file not shown.
1 change: 1 addition & 0 deletions deepdataspace/server/static/573.b863d4dd.async.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion deepdataspace/server/static/630.403767d5.async.js

This file was deleted.

1 change: 1 addition & 0 deletions deepdataspace/server/static/630.95df8b41.async.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions deepdataspace/server/static/714.19514423.async.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions deepdataspace/server/static/818.abe18eb2.async.js

This file was deleted.

1 change: 0 additions & 1 deletion deepdataspace/server/static/867.cf8cbc3e.async.js

This file was deleted.

4 changes: 2 additions & 2 deletions deepdataspace/server/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<meta name="description" content="cvr">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="shortcut icon" href="/static/favicon.png">
<link rel="stylesheet" href="/static/umi.388a0f18.css">
<link rel="stylesheet" href="/static/umi.e42093b9.css">
</head>
<body>
<div id="root"></div>
<script src="/static/umi.42fdc3a8.js"></script>
<script src="/static/umi.da94c048.js"></script>

</body></html>

This file was deleted.

Loading

0 comments on commit 8d146db

Please sign in to comment.