Skip to content

Commit

Permalink
Merge pull request #7 from bbsaclay/master
Browse files Browse the repository at this point in the history
v0.6.0
  • Loading branch information
bbsaclay authored Apr 7, 2022
2 parents d88ff99 + 5664755 commit b850f5a
Show file tree
Hide file tree
Showing 25 changed files with 236 additions and 708 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
build/
package-lock.json
*-bundle.js
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY server server
COPY .logo-ascii .logo-ascii

# Build frontend and install backend dependencies
RUN npm deps && npm run build && rm -rf frontend
RUN npm run deps && npm run build && rm -rf frontend

EXPOSE 3000

Expand Down
13 changes: 6 additions & 7 deletions Dockerfile-local
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
FROM ubuntu:20.04

# Install Node.js
RUN apt-get update && apt-get install -y --reinstall ca-certificates curl build-essential
RUN curl --silent --location https://deb.nodesource.com/setup_12.x | bash -
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y nodejs
RUN npm install -g [email protected]
RUN node --version

# Copy bundled frontend
# Copy bundled frontend and backend dependencies
COPY build build
COPY node_modules node_modules

# Copy files for the backend
COPY package.json package.json
COPY server server
COPY .logo-ascii .logo-ascii

# Install backend dependencies
RUN npm install
EXPOSE 3000

# default files and folders (usefull when no volume can be mounted with this image)
RUN mkdir -p /data

COPY data-test /data/data-test

# ENTRYPOINT ["node", "server/server.js"]
RUN echo 'cat .logo-ascii && node server/server.js "$@"' > entrypoint.sh
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pixano ./data-test --port 3001

#### Install global dependencies

- NodeJS (>=12)
- NodeJS (10, 12 or 14)
To install on ubuntu:

```bash
Expand All @@ -78,6 +78,8 @@ nodejs --version
npm install -g [email protected]
```
You can read this nice [introduction](https://codeburst.io/the-only-nodejs-introduction-youll-ever-need-d969a47ef219) to NodeJS in case you're curious on how it works.

> ATTENTION: node version 16 is not compatible for now
#### Install application dependencies

Expand All @@ -90,10 +92,16 @@ If you want to use custom `pixano-element` modules from local path instead of th

```bash
# Install application dependencies and local pixano-elements
npm run installLocalElements --path=../../pixano-elements
npm run installLocalElements --path=$PIXANO_ELEMENTS_PATH
```
*NB: Make sure you have the git repository of pixano-elements next to the pixano-app folder and that you have followed the pixano-elements build instructions before running the above commands.*

If this command breaks your local pixano-elements demo, this command will repear it:
```bash
cd $PIXANO_ELEMENTS_PATH
npm run bootstrap
```

#### Build the application

```bash
Expand Down Expand Up @@ -187,10 +195,13 @@ The `task1.json` file contains global task settings (task type, task categories,

### Build docker from sources

To create a docker image of the application, build the application (step 1.b) and then run:
To create a docker image of the application, you can use the standard docker command:
```bash
# You can change `pixano` by your choosen image name
sudo docker build -t pixano/pixano-app:my-tag .
```
If you used a local pixano-element, build the application (step 1.b) and then run:
```bash
# You can use the local Dockerfile if the build folder already exists
sudo docker build -t pixano/pixano-app:my-tag -f Dockerfile-local .
```
Expand Down
2 changes: 1 addition & 1 deletion documentation/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This document lists the API of the Pixano server that enable the creation of new
type Objective = 'to_annotate' | 'to_validate' | 'to_correct';

// possible status a data item can have
type LabellingStatus = Objective | 'done';
type LabellingStatus = Objective | 'done' | 'discard';

// possible types a data item can have
type DataType = 'image' | 'pcl' | 'pcl_image' | 'sequence_pcl' | 'sequence_image' | 'sequence_pcl_image';
Expand Down
10 changes: 5 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pixano-app-frontend",
"version": "0.5.0",
"version": "0.6.0",
"description": "This is a Pixano app.",
"scripts": {
"copyindex": "shx cp src/index.html ../build",
Expand Down Expand Up @@ -49,10 +49,10 @@
"@material/mwc-tab-bar": "0.19.1",
"@material/mwc-textarea": "0.19.1",
"@material/mwc-textfield": "0.19.1",
"@pixano/ai": "0.6.1",
"@pixano/core": "0.6.1",
"@pixano/graphics-2d": "0.6.1",
"@pixano/graphics-3d": "0.6.1",
"@pixano/ai": "0.7.0",
"@pixano/core": "0.7.0",
"@pixano/graphics-2d": "0.7.0",
"@pixano/graphics-3d": "0.7.0",
"@trystan2k/fleshy-jsoneditor": "3.0.0",
"@webcomponents/webcomponentsjs": "^2.4.0",
"babel-loader": "^8.2.3",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/actions/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const _requestHelper = (method, url = "/api/v1/", body = undefined, dispatch = n
dispatch(updateWaiting(true));
}
return new Promise((resolve, reject) => {
return fetch(url, messageContent).then((response) => {
return fetch(encodeURI(url), messageContent).then((response) => {
if (dispatch) {
dispatch(updateWaiting(false));
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ class MyApp extends connect(store)(LitElement) {
goHome() {
const user = getState('user');
const page = user.currentUser.role === 'admin' ? '/#dashboard-admin': '/#dashboard-user';
window.history.pushState({}, '', page);
window.history.pushState({}, '', encodeURI(page));
store.dispatch(navigate(page));
}

goLogin() {
const page = '/#login';
window.history.pushState({}, '', page);
window.history.pushState({}, '', encodeURI(page));
store.dispatch(navigate(page));
}

Expand Down
Loading

0 comments on commit b850f5a

Please sign in to comment.