Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.png
node_modules/
pytc/
pytorch_connectomics/
logs/
data/
outputs/
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "pytorch_connectomics"]
path = pytorch_connectomics
url = https://github.com/zudi-lin/pytorch_connectomics.git
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#centOS
FROM nvidia/cuda:11.1.1-devel-ubi8

# Enable AppStream and install Python 3.9
# Enable AppStream and install Python 3.9 and git
RUN yum -y module enable python39 && \
yum install -y python39-3.9.2 && \
yum install -y python39-devel-3.9.2 && \
yum install -y git && \
yum clean all && \
(python3.9 --version || echo "Python installation failed" && exit 1)

Expand All @@ -21,7 +22,11 @@ WORKDIR /app
# Install dependencies
RUN pip3 install --no-cache-dir torch==1.9.0 torchvision==0.10.0 cuda-python==11.1.1

COPY ./pytorch_connectomics /app/pytorch_connectomics
# Download pytorch_connectomics at specific commit (version 1.0)
RUN git clone https://github.com/zudi-lin/pytorch_connectomics.git /app/pytorch_connectomics && \
cd /app/pytorch_connectomics && \
git checkout 20ccfde

COPY ./samples_pytc /app/samples_pytc
COPY ./server_pytc /app/server_pytc
COPY ./server_api /app/server_api
Expand All @@ -35,9 +40,10 @@ WORKDIR /app/server_api
RUN pip3 install --no-cache-dir -r requirements.txt

WORKDIR /app
# Copies the startup script, and runs it at CMD
# Copies the startup scripts, and runs it at CMD
COPY ./start.sh /app/
RUN chmod +x start.sh
COPY ./setup_pytorch_connectomics.sh /app/
RUN chmod +x start.sh setup_pytorch_connectomics.sh

# Expose ports
EXPOSE 4242 4243 4244 6006
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,17 @@ pip install -r requirements.txt

In root folder,
```bash
# The setup script will automatically download pytorch_connectomics at commit 20ccfde (version 1.0)
./setup_pytorch_connectomics.sh
cd pytorch_connectomics
pip install --editable .
```

Alternatively, you can run this manually:
```bash
git clone https://github.com/zudi-lin/pytorch_connectomics.git
cd pytorch_connectomics
git checkout 20ccfde
pip install --editable .
```

Expand Down
6,951 changes: 2,744 additions & 4,207 deletions client/package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"antd": "^5.18.1",
"axios": "^1.7.2",
"buffer": "^6.0.3",
"electron": "^31.2.1",
"electron": "^38.3.0",
"js-yaml": "^4.1.0",
"localforage": "^1.10.0",
"nth-check": "^2.1.1",
Expand All @@ -20,7 +20,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1",
"react-scripts": "5.0.1",
"react-scripts": "^5.0.1",
"utif": "^3.1.0",
"web-vitals": "^4.1.1"
},
Expand Down Expand Up @@ -58,6 +58,7 @@
"overrides": {
"nth-check": "$nth-check",
"resolve-url-loader": "^5.0.0",
"svgo": "^3.3.2"
"svgo": "^3.3.2",
"webpack-dev-server": "^5.2.1"
}
}
37 changes: 33 additions & 4 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,44 @@
import { useContext, useEffect, useState } from 'react'
import './App.css'
import Views from './views/Views'
import { ContextWrapper } from './contexts/GlobalContext'
import { AppContext, ContextWrapper } from './contexts/GlobalContext'
import { YamlContextWrapper } from './contexts/YamlContext'

function CacheBootstrapper ({ children }) {
const { resetFileState } = useContext(AppContext)
const [isCacheCleared, setIsCacheCleared] = useState(false)

useEffect(() => {
let isMounted = true
const clearCache = async () => {
await resetFileState()
if (isMounted) {
setIsCacheCleared(true)
}
}

clearCache()
return () => {
isMounted = false
}
}, [resetFileState])

if (!isCacheCleared) {
return null
}

return children
}

function App () {
return (
<ContextWrapper>
<YamlContextWrapper>
<div className='App'>
<Views />
</div>
<CacheBootstrapper>
<div className='App'>
<Views />
</div>
</CacheBootstrapper>
</YamlContextWrapper>
</ContextWrapper>
)
Expand Down
Loading
Loading