Skip to content

Commit

Permalink
fixing webapp build (#162)
Browse files Browse the repository at this point in the history
* fixes #161

* changelog

* testing pypi workflow

* syntax fix

* changing npm to nodejs in conda build

* updating contributing guide

* some fixes

* testing publish workflow

* fixes

* disabling pypi workflow on this branch

* temporarily disabling conda workflow

* temporarily disabling codeql

* testing without node setup

* fix gitignore and remove entire build dir contents

* fix yarn install, update README

* add yarn to github workflow, upgrade node to v16

* forgot to add uses:yarn to tests.yml

* fix tests.yml webapp build, reverting pypi.yml

* Removing branch name in publish workflow

* Re-enabling codeql

* Re-enabling conda workflow

* Re-enabling image push to ECR

* fixing conda

* testing fix

* testing npm and yarn within container

* Removing npm and yarn test

* Testing npm and yarn install

* Replacing setup-node step with npm-yarn install

* Fixed duplicate container names

* Testing one container

* Trying install within build webapp

* Fixing syntax errors

* Fixing syntax errors

* Testing node install again

* Removing sudo

* Removing flag

* Adding all container types

* Adding all container types again

* Adding python-38-centos7

* Syntax error fix

* Syntax error fix

* Separate step for centos

* Retrying centos install

* Fix syntax error

* Fix syntax error

* Fix syntax error

* Checking permissions

* Checking permissions

* Removing duplicate conditions

* Reverting steps

* Fixes

* Fixes

* More fixes

* More fixes

* More fixes

* Fixes

* Fixes

* Fixes

* Fixes on centos

* Fixes on centos

* Fixes on centos

* fixing tests

* adding build validation to tests

* testing a fix

* testing a fix

* testing a fix

* testing mac

* testing mac

* testing mac

* re-enabling all workflows

Co-authored-by: Valentin Kostadinov <[email protected]>
Co-authored-by: Okechukwu Ochia <[email protected]>
  • Loading branch information
3 people authored Mar 9, 2022
1 parent 8b273ab commit bb365aa
Show file tree
Hide file tree
Showing 35 changed files with 17,367 additions and 398 deletions.
1 change: 0 additions & 1 deletion .github/workflows/condabuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ jobs:
conda create --name buildenv python=3.8
$CONDA/bin/activate buildenv
conda build --override-channels .
9 changes: 9 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install twine
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 16
- name: Build Webapp
run: |
cd ./covalent_ui/webapp
yarn install
yarn build
- name: Build Distribution
run: python setup.py sdist
- name: Validate Distribution
Expand Down
34 changes: 33 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ jobs:
- python:3.8-bullseye
- python:3.9-buster
- python:3.9-bullseye
- centos/python-38-centos7
- image: "centos/python-38-centos7"
options: "--user root"
experimental: [false]
include:
- os: macos-latest
Expand All @@ -60,6 +61,37 @@ jobs:
run: |
pip install --no-cache-dir -r ./requirements.txt
pip install --no-cache-dir -r ./tests/requirements.txt
- name: Install NPM and Yarn on Ubuntu
if: matrix.container == 'python:3.8-buster' || matrix.container == 'python:3.8-bullseye' || matrix.container == 'python:3.9-buster' || matrix.container == 'python:3.9-bullseye'
run: |
apt-get update && apt-get install -y curl
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs
npm install -g yarn
- name: Install NPM and Yarn on CentOS
if: matrix.container.image == 'centos/python-38-centos7'
run: |
yum remove -y npm nodejs
curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -
yum install -y npm nodejs
npm install -g yarn
- name: Build webapp
run: |
cd ./covalent_ui/webapp
yarn install
yarn build
- name: Build distribution
run: python setup.py sdist
- name: Validate distribution
run: |
VERSION="$(cat ./VERSION)"
cd dist
tar xzf cova-${VERSION}.tar.gz
diff -r cova-${VERSION}/covalent ../covalent
diff -r cova-${VERSION}/covalent_dispatcher ../covalent_dispatcher
diff -x README.md cova-${VERSION}/covalent_ui ../covalent_ui
diff -r cova-${VERSION}/covalent_ui/webapp/build ../covalent_ui/webapp/build
rm -rf cova-${VERSION}/
- name: Install Covalent
run: pip install -e .
- name: Start Covalent dispatcher server
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.29.3] - 2022-03-09

### Fixed

- Covalent UI is built in the Dockerfile, the setup file, the pypi workflow, the tests workflow, and the conda build script.

## [0.29.2] - 2022-03-09

### Added
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ conda activate covalent-dev

Install Covalent's core requirements as well as the developer requirements:
```shell
conda install setuptools pip
conda install setuptools pip nodejs yarn
python setup.py webapp
pip install -e .
pip install -r tests/requirements.txt
pre-commit install
Expand Down
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,22 @@

FROM python:3.8-slim-buster

RUN apt-get update && apt-get install -y \
gcc \
RUN apt-get update \
&& apt-get install -y curl gcc \
&& curl -sL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install -y nodejs \
&& npm install --global yarn \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /opt/covalent
COPY . /opt/covalent
RUN pip install --no-cache-dir --use-feature=in-tree-build /opt/covalent
RUN cd /opt/covalent/covalent_ui/webapp \
&& yarn install \
&& yarn build

WORKDIR /opt/covalent

EXPOSE 8080
ENTRYPOINT [ "python" ]
CMD ["/opt/covalent/covalent_ui/app.py", "--port", "8080"]
CMD ["/opt/covalent/covalent_ui/app.py", "--port", "8080"]
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.29.2
0.29.3
Empty file.
47 changes: 33 additions & 14 deletions covalent_ui/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,51 @@
# Covalent UI

## Running UI server
## Setup

- Start UI server
- Activate conda environment and install required packages:

```shell
cd covalent_ui
flask run --port 48008
conda activate <covalent-env>
pip install -r requirement.txt
```

- Open `http://localhost:48008` in your browser.
- Dispatch workflows to explore them in the UI.
- Install `node` (v16 or later) and `npm`:

## Setup details
```shell
# Linux
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs

- Ensure python environment is properly set up with all required packages installed.
# macOS
brew install node
```

- Install `yarn`:

```shell
conda activate <covalent-env>
pip install -r requirement.txt
npm install --global yarn
```

- The UI server does not require the **Covalent Dispatcher** to be running but it receives execution updates from it.
## Build web app

- Results are currently persisted in the browser client's `localStorage`.
```
cd covalent_ui/webapp
yarn install
yarn build
```

## Run server

```shell
cd covalent_ui
python app.py -p <port>
```

- Open `http://0.0.0.0:<port>` in your browser.
- Dispatch workflows to explore them in the UI.

## Frontend development

- The optimized production build of the UI web app lives under `covalent_ui/webapp/build`. It is statically served by the UI server by default.
- The optimized production build of the UI web app lives under `covalent_ui/webapp/build`. It is statically served by the server by default.

- See `covalent_ui/webapp/README.me` for details on how to build and run the development.
- For the development version of the web app, see `covalent_ui/webapp/README.me`
2 changes: 1 addition & 1 deletion covalent_ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ def serve(path):
else:
port = DEFAULT_PORT
debug = True if args.develop is True else False
socketio.run(app, debug=debug, host="0.0.0.0", port=port)
socketio.run(app, debug=debug, host="0.0.0.0", port=port, use_reloader=True)
4 changes: 2 additions & 2 deletions covalent_ui/webapp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# testing
/coverage

# production
!build
# production build
/build

# misc
.DS_Store
Expand Down
23 changes: 0 additions & 23 deletions covalent_ui/webapp/build/asset-manifest.json

This file was deleted.

Binary file removed covalent_ui/webapp/build/favicon64x64.ico
Binary file not shown.
1 change: 0 additions & 1 deletion covalent_ui/webapp/build/index.html

This file was deleted.

Binary file removed covalent_ui/webapp/build/logo192x192.png
Binary file not shown.
Binary file removed covalent_ui/webapp/build/logo512x512.png
Binary file not shown.
Binary file removed covalent_ui/webapp/build/logo64x64.png
Binary file not shown.
25 changes: 0 additions & 25 deletions covalent_ui/webapp/build/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions covalent_ui/webapp/build/robots.txt

This file was deleted.

2 changes: 0 additions & 2 deletions covalent_ui/webapp/build/static/css/main.5658d761.chunk.css

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions covalent_ui/webapp/build/static/js/2.672a2ea9.chunk.js

This file was deleted.

105 changes: 0 additions & 105 deletions covalent_ui/webapp/build/static/js/2.672a2ea9.chunk.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion covalent_ui/webapp/build/static/js/2.672a2ea9.chunk.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions covalent_ui/webapp/build/static/js/main.1028cf84.chunk.js

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions covalent_ui/webapp/build/static/js/runtime-main.533164ea.js

This file was deleted.

Loading

0 comments on commit bb365aa

Please sign in to comment.