Skip to content

Commit

Permalink
Allow production builds for UI packages (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
caponetto authored Oct 2, 2024
1 parent 397197b commit be70204
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
run: |
make build-dependencies
make yarn-install
make build-ui
make build-ui-prod
- name: Install
run: make install-server
- name: Test
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
run: |
make build-dependencies
make yarn-install
make build-ui
make build-ui-prod
- name: Install
run: |
make install-server
Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
yarn --version
- name: Build
run: |
make clean install
make install-prod
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
echo "::info title='$LATEST_TAG tag is ready to be released to PyPI' ::"
- name: Build package
run: |
make install
make install-prod
- name: Publish package on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
.PHONY: help purge uninstall clean
.PHONY: lint-dependencies lint-server black-format prettier-check-ui eslint-check-ui prettier-ui eslint-ui lint-ui lint
.PHONY: dev-link dev-unlink
.PHONY: build-dependencies dev-dependencies yarn-install build-ui package-ui package-ui-dev
.PHONY: build-dependencies dev-dependencies yarn-install build-ui-prod build-ui-dev package-ui-prod package-ui-dev
.PHONY: build-server install-server-package install-server
.PHONY: install install-all install-dev install-examples install-gitlab-dependency check-install watch release
.PHONY: install-prod install-dev install-all-prod install-all-dev install-examples install-gitlab-dependency check-install watch release
.PHONY: test-dependencies pytest test-server test-ui-unit test-integration test-integration-debug test-ui test
.PHONY: docs-dependencies docs
.PHONY: elyra-image elyra-image-env publish-elyra-image kf-notebook-image publish-kf-notebook-image
Expand Down Expand Up @@ -148,12 +148,15 @@ dev-dependencies:
yarn-install:
yarn install

build-ui: # Build packages
build-ui-prod: ## Build UI packages for production
yarn lerna run build:prod --stream

build-ui-dev: ## Build UI packages for development
yarn lerna run build --stream

package-ui: build-dependencies yarn-install lint-ui build-ui
package-ui-prod: build-dependencies yarn-install lint-ui build-ui-prod ## Package UI for production

package-ui-dev: dev-dependencies yarn-install dev-link lint-ui build-ui
package-ui-dev: dev-dependencies yarn-install dev-link lint-ui build-ui-dev ## Package UI for development

build-server: # Build backend
$(PYTHON) -m build
Expand All @@ -166,11 +169,13 @@ install-server-package: uninstall-server-package

install-server: build-dependencies lint-server build-server install-server-package ## Build and install backend

install: package-ui install-server check-install ## Build and install
install-prod: package-ui-prod install-server check-install ## Build and install for production

install-dev: package-ui-dev install-server check-install ## Build and install for development

install-all: package-ui install-server install-examples install-gitlab-dependency check-install ## Build and install, including examples
install-all-prod: package-ui-prod install-server install-examples install-gitlab-dependency check-install ## Build and install for production, including examples

install-dev: package-ui-dev install-server install-examples install-gitlab-dependency check-install
install-all-dev: package-ui-dev install-server install-examples install-gitlab-dependency check-install ## Build and install for development, including examples

install-examples: ## Install example pipeline components
# install Kubeflow Pipelines example components
Expand All @@ -189,7 +194,7 @@ check-install:
watch: ## Watch packages. For use alongside jupyter lab --watch
yarn lerna run watch --parallel

release: yarn-install build-ui build-server ## Build wheel file for release
release: yarn-install build-ui-prod build-server ## Build wheel file for release


elyra-image-env: ## Creates a conda env consisting of the dependencies used in images
Expand Down
39 changes: 23 additions & 16 deletions docs/source/developer_guide/development-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
{% endcomment %}
-->
## Development Workflow
This section describes the steps necessary to build Elyra in a development environment.
This section describes the steps necessary to build Elyra in a development environment.

#### Requirements

Expand Down Expand Up @@ -60,29 +60,29 @@ Download and install a [Python 3 version of Miniconda](https://docs.conda.io/en/
```
conda install -y -c conda-forge/label/main nodejs
```
* Verify node is installed correctly
* Verify node is installed correctly
```
node --version
node --version
```
* Install Yarn
```
conda install -y -c conda-forge/label/main yarn
```
* Verify yarn is installed correctly
* Verify yarn is installed correctly
```
yarn --version
yarn --version
```
* Install GNU Make
* Install GNU Make
Refer to the following link for installation instructions:
Refer to the following link for installation instructions:
[GNU Make](https://www.gnu.org/software/make/)
To verify the installation, run `make`.
To verify the installation, run `make`.
If you have yet to [set up the repository](#setting-up-your-development-environment), you should see a message like the following:
```
make: *** No targets specified and no makefile found. Stop.
Expand All @@ -103,7 +103,7 @@ Download and install a [Python 3 version of Miniconda](https://docs.conda.io/en/
### Building
Elyra is divided in two parts, a collection of Jupyter Notebook backend extensions,
and their respective JupyterLab UI extensions. Our JupyterLab extensions are located in our `packages`
directory.
directory.
#### Build & Installation
Expand All @@ -114,14 +114,21 @@ Issuing a `make` command with no task specified will provide a list of the curre
```bash
$ make
build-ui-dev Build UI packages for development
build-ui-prod Build UI packages for production
clean Make a clean source tree and uninstall extensions
container-images Build all container images
docs Build docs
install-all Build and install, including examples
elyra-image-env Creates a conda env consisting of the dependencies used in images
install-all-dev Build and install for development, including examples
install-all-prod Build and install for production, including examples
install-dev Build and install for development
install-examples Install example pipeline components
install-prod Build and install for production
install-server Build and install backend
install Build and install
lint Run linters
package-ui-dev Package UI for development
package-ui-prod Package UI for production
publish-container-images Publish all container images
release Build wheel file for release
test Run all tests (backend, frontend and cypress integration tests)
Expand All @@ -131,7 +138,7 @@ watch Watch packages. For use alongside jupyter lab --w
You can build and install all Elyra packages with:

```bash
make clean install
make clean install-prod
```

You can check that the notebook server extension was successfully installed with:
Expand All @@ -144,7 +151,7 @@ You can check that the JupyterLab extension was successfully installed with:
jupyter labextension list
```

> NOTE:
> NOTE:
When switching between Elyra major versions, it is recommended to clean your JupyterLab environment before a build.
The `clean-jupyterlab` removes your JupyterLab packages and completely deletes your Jupyter workspace.
Make sure to backup any important data in your environment before running the script.
Expand Down Expand Up @@ -204,14 +211,14 @@ make elyra-image
By default, the command above will build a container image (development) with the changes that exist in your local branch.


Production:
Production:
From main branch:
```bash
make elyra-image TAG=3.7.0
```
or after checking out a git tag e.g. `git checkout tags/v3.7.0`
```bash
make elyra-image
make elyra-image
```
In order to build from a particular release (production), you can pass a `TAG` parameter to the make command
or you can checkout the respective tagged release and omit the `TAG` parameter.
Expand Down Expand Up @@ -268,4 +275,4 @@ The test results can be accessed from the pull request or the _actions_ tab. If
![Open workflow summary](../images/developer_guide/development-workflow/open-workflow-summary.png)
1. Locate the 'Artifacts' section. If present, it should contain a download link.
![Locate artifacts](../images/developer_guide/development-workflow/locate-artifacts.png)
1. Download the archive, extract it, and review the artifacts.
1. Download the archive, extract it, and review the artifacts.
4 changes: 2 additions & 2 deletions etc/docker/kubeflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.

This `Dockerfile` is used to build an Elyra notebook image that can be launched by [Kubeflow's Notebook Server](https://www.kubeflow.org/docs/components/notebooks/).

Ready-to-use container images are published on [Docker Hub](https://hub.docker.com/r/elyra/kf-notebook) and [quay.io](https://quay.io/repository/elyra/kf-notebook).
Ready-to-use container images are published on [Docker Hub](https://hub.docker.com/r/elyra/kf-notebook) and [quay.io](https://quay.io/repository/elyra/kf-notebook).
Refer to [the documentation](https://elyra.readthedocs.io/en/latest/recipes/using-elyra-with-kubeflow-notebook-server.html) for details.

#### Building a custom container image
Expand All @@ -29,5 +29,5 @@ To build a custom version of this container image:
1. Clone this repository
2. Build the container image:
- (Option 1) Build from official distributables: In the repository root directory run `make kf-notebook-image TAG=3.X.X` to create an image using the 3.X.X release from PyPI.
- (Option 2) Build from local source: In the repository root directory run `make kf-notebook-image TAG=dev` _after_ running `make install` to build Elyra locally.
- (Option 2) Build from local source: In the repository root directory run `make kf-notebook-image TAG=dev` _after_ running `make install-prod` to build Elyra locally.
3. The container image is automatically tagged with `elyra/kf-notebook:$TAG` and `quay.io/elyra/kf-notebook:$TAG`

0 comments on commit be70204

Please sign in to comment.