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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ micromamba/
.env
oauth2_creds.json
data.duckdb

# pixi environments
.pixi
*.egg-info

# Local Netlify folder
.netlify
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# cmake-w3-externaldata-upload

[![screenshot](./screenshot.png)](https://cmake-w3-externaldata-upload.on.fleek.co/)
[![screenshot](./screenshot.png)](https://content-link-upload.netlify.app)

[CMake Web3 ExternalData Upload UI](https://cmake-w3-externaldata-upload.on.fleek.co/)
[CMake Web3 ExternalData Upload UI](https://content-link-upload.netlify.app)

Based on [the web3.storage browser client](https://web3.storage/docs/reference/js-client-library/#store-files) and [w3ui](https://github.com/web3-storage/w3ui).

Expand Down Expand Up @@ -57,7 +57,6 @@ the following:
- Peer [IPFS](https://ipfs.io/) nodes
- [web3.storage](https://web3.storage/)
- [pinata.cloud](https://pinata.cloud)
- Kitware\'s HTTP Server

*Note: This currently requires an extended version of the ExternalData.cmake module developed in the [CMakeIPFSExternalData repository](https://github.com/InsightSoftwareConsortium/CMakeIPFSExternalData). This has not been integrated into upstream CMake due to the availability of C++ CID verification code to complete the feature set in a
portable way.*
Expand All @@ -71,13 +70,16 @@ git clone https://github.com/InsightSoftwareConsortium/cmake-w3-externaldata-upl
cd cmake-w3-externaldata-upload
```

Change to this directory and install dependencies
Install [pixi](https://pixi.sh/) if not already installed:

```sh
cd cmake-w3-externaldata-upload
npm install --location=global pnpm
pnpm install
pnpm setup-micromamba
curl -fsSL https://pixi.sh/install.sh | sh
```

Start with an empty database:

```sh
cp data.duckdb.empty data.duckdb
```

### Populate .env
Expand All @@ -95,22 +97,22 @@ For monitor emails, set the [MailJet](https://mailjet.com) keys `MJ_APIKEY_PUBLI
### Run the dev server

```sh
pnpm dev
pixi run start
```

This starts, a [hypha server](https://ha.amun.ai/#/), a hypha Python service, and the client side build, and serves them locally.

To test production builds instead, run
Visit [http://localhost:9000/app/index.html](http://localhost:9000/app/index.html) to view the application.

```sh
pnpm start-hypha-service
```
### Production service

in one terminal and
The production server currently runs on a cloud VM with

```sh
pnpm build
pnpm preview
pixi run start-hypha-service
```

in another.
Running under [supervisord](https://supervisord.org/).

The content-link-upload.itk.org is served on
https://content-link-upload.netlify.app and built via `pnpm run build`.
15 changes: 0 additions & 15 deletions environment.yml

This file was deleted.

16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "cmake-w3-externaldata-upload",
"version": "2.0.0",
"version": "3.0.0",
"scripts": {
"start": "concurrently -n \"hypha,vite\" --success first -k \"pnpm start-hypha\" \"vite build --sourcemap true --watch\"",
"dev": "pnpm start",
"build": "VITE_HYPHA_SERVER_URL=https://ai.imjoy.io vite build",
"setup-micromamba": "setup-micromamba --micromamba-binary-path ./micromamba/micromamba --micromamba-root-path ./micromamba --init-shell none --create-environment true --environment-file environment.yml --log-level info --run-command \"clean -fya\"",
"start-hypha": "pnpm setup-micromamba && ./micromamba/micromamba run -e VITE_HYPHA_SERVER_URL=http://localhost:9000 -e PYTHONPATH=./src -r micromamba -n cmake-w3-externaldata hypha --host=0.0.0.0 --port=9000 --startup-functions=./src/hypha-startup-functions.py:hypha_startup --static-mounts=/app/:./dist/",
"start-hypha-service": "pnpm setup-micromamba && ./micromamba/micromamba run -e VITE_HYPHA_SERVER_URL=https://ai.imjoy.io -e PYTHONPATH=./src -r micromamba -n cmake-w3-externaldata python ./src/register-hypha-uploader-service.py",
"preview": "VITE_HYPHA_SERVER_URL=https://ai.imjoy.io vite preview --port 4173"
"build": "VITE_HYPHA_SERVER_URL=https://hypha.website BASE_DIR=/ vite build",
"start-hypha": "VITE_HYPHA_SERVER_URL=http://localhost:9000 PYTHONPATH=./src hypha --host=0.0.0.0 --port=9000 --startup-functions=./src/hypha-startup-functions.py:hypha_startup --static-mounts=/app/:./dist/",
"start-hypha-service": "VITE_HYPHA_SERVER_URL=https://hypha.website PYTHONPATH=./src python ./src/register-hypha-uploader-service.py",
"preview": "VITE_HYPHA_SERVER_URL=https://hypha.website vite preview --port 4173"
},
"dependencies": {
"@ipld/car": "^5.2.6",
Expand All @@ -18,11 +17,10 @@
"commander": "^11.1.0",
"dotenv": "^16.3.1",
"files-from-path": "^1.0.4",
"imjoy-rpc": "^0.5.46"
"hypha-rpc": "0.20.53-post-1"
},
"devDependencies": {
"@thewtex/setup-micromamba": "^1.9.7",
"concurrently": "^8.2.2",
"vite": "^3.1.4"
"vite": "^6.3.5"
}
}
Loading