Skip to content

Commit

Permalink
Fix AWS deployment (#1316)
Browse files Browse the repository at this point in the history
* Don't use antd less (big memory consumtion during the build process)
* Fix AWS deployment guide
* fix a problem with proxy and long domain names
* remove sass loader for antd
* Removed less and less-loader.
* Simplified webpack config.
  • Loading branch information
nmanovic authored Mar 26, 2020
1 parent 76d0c6b commit ecad023
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 271 deletions.
5 changes: 2 additions & 3 deletions Dockerfile.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ ENV TERM=xterm \
http_proxy=${http_proxy} \
https_proxy=${https_proxy} \
no_proxy=${no_proxy} \
socks_proxy=${socks_proxy}

ENV LANG='C.UTF-8' \
socks_proxy=${socks_proxy} \
LANG='C.UTF-8' \
LC_ALL='C.UTF-8'

# Install dependencies
Expand Down
422 changes: 190 additions & 232 deletions cvat-ui/package-lock.json

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions cvat-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-react-hooks": "^1.7.0",
"html-webpack-plugin": "^3.2.0",
"less": "^3.10.3",
"less-loader": "^5.0.0",
"node-sass": "^4.13.0",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.7.0",
Expand All @@ -42,7 +40,7 @@
"style-loader": "^1.0.0",
"tsconfig-paths-webpack-plugin": "^3.2.0",
"typescript": "^3.7.3",
"webpack": "^4.41.2",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.8",
"webpack-dev-server": "^3.8.0"
},
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/src/components/cvat-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: MIT

import 'antd/dist/antd.less';
import 'antd/dist/antd.css';
import '../styles.scss';
import React from 'react';
import { Switch, Route, Redirect } from 'react-router';
Expand Down
9 changes: 0 additions & 9 deletions cvat-ui/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,8 @@ module.exports = {
sourceType: 'unambiguous',
},
},
}, {
test: /node_modules\/antd\/[\w\/]*.less$/,
use: ['style-loader', 'css-loader', {
loader: 'less-loader',
options: {
javascriptEnabled: true,
},
}]
}, {
test: /\.(css|scss)$/,
exclude: /node_modules/,
use: ['style-loader', {
loader: 'css-loader',
options: {
Expand Down
28 changes: 7 additions & 21 deletions cvat/apps/documentation/AWS-Deployment-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,15 @@ There are two ways of deploying the CVAT.
1. **On Nvidia GPU Machine:** Tensorflow annotation feature is dependent on GPU hardware. One of the easy ways to launch CVAT with the tf-annotation app is to use AWS P3 instances, which provides the NVIDIA GPU. Read more about [P3 instances here.](https://aws.amazon.com/about-aws/whats-new/2017/10/introducing-amazon-ec2-p3-instances/)
Overall setup instruction is explained in [main readme file](https://github.com/opencv/cvat/), except Installing Nvidia drivers. So we need to download the drivers and install it. For Amazon P3 instances, download the Nvidia Drivers from Nvidia website. For more check [Installing the NVIDIA Driver on Linux Instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-nvidia-driver.html) link.

2. **On Any other AWS Machine:** We can follow the same instruction guide mentioned in the [Readme file](https://github.com/opencv/cvat/). The additional step is to add a [security group and rule to allow incoming connections](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html).
2. **On Any other AWS Machine:** We can follow the same instruction guide mentioned in the
[installation instructions](https://github.com/opencv/cvat/blob/master/cvat/apps/documentation/installation.md).
The additional step is to add a [security group and rule to allow incoming connections](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html).

For any of above, don't forget to add exposed AWS public IP address and port to `docker-compose.override.yml`:

You need at least 2 opened ports on your Amazon instance, for UI and Django apps.
For any of above, don't forget to add exposed AWS public IP address or hostname to `docker-compose.override.yml`:

```
version: "2.3"
services:
cvat:
cvat_proxy:
environment:
UI_HOST: *your Amazon AWS instance's url or IP*
UI_PORT: *port for UI app*
ports:
- "REACT_APP_API_PORT specified below:8080"
cvat_ui:
build:
args:
REACT_APP_API_HOST: *your Amazon AWS instance's url or IP*
REACT_APP_API_PORT: *port for Django app*
ports:
- "UI_PORT specified above":80"
```
CVAT_HOST: your-instance.amazonaws.com
```
6 changes: 4 additions & 2 deletions cvat_proxy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ http {
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# For long domain names (e.g. AWS hosts)
server_names_hash_bucket_size 128;

include /etc/nginx/conf.d/*.conf;
client_max_body_size 0;
include /etc/nginx/conf.d/*.conf;
client_max_body_size 0;
}

0 comments on commit ecad023

Please sign in to comment.