Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dsuhinin/user-auth-part-2' into …
Browse files Browse the repository at this point in the history
…dsuhinin/user-auth-part-2
  • Loading branch information
dsuhinin committed Mar 27, 2024
2 parents 61d7c14 + 8620e25 commit 769970b
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 61 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "ui/fasttrackml-ui-aim"]
path = ui/fasttrackml-ui-aim
url = ssh://[email protected]/g-research/fasttrackml-ui-aim.git
[submodule "ui/fasttrackml-ui-mlflow"]
path = ui/fasttrackml-ui-mlflow
url = ssh://[email protected]/g-research/fasttrackml-ui-mlflow.git
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ COMPOSE_FILE=tests/integration/docker-compose.yml
# Docker compose project name.
COMPOSE_PROJECT_NAME=$(APP)-integration-tests

AIM_BUILD_LOCATION=$(HOME)/fasttrackml-ui-aim
MLFLOW_BUILD_LOCATION=$(HOME)/fasttrackml-ui-mlflow

#
# Default target (help).
#
Expand Down Expand Up @@ -255,3 +258,17 @@ migrations-create: ## generate a new database migration.
migrations-rebuild: ## rebuild the migrations script to detect new migrations.
@echo ">>> Running FastTrackML migrations rebuild."
@go run main.go migrations rebuild

.PHONY: ui-aim-start
ui-aim-start: ## start the Aim UI for development.
@echo ">>> Syncing the Aim UI."
@rsync -rvu --exclude node_modules --exclude .git ui/fasttrackml-ui-aim/ $(AIM_BUILD_LOCATION)
@echo ">>> Starting the Aim UI."
@cd $(AIM_BUILD_LOCATION)/src && npm ci --legacy-peer-deps && npm start

.PHONY: ui-mlflow-start
ui-mlflow-start: ## start the MLflow UI for development.
@echo ">>> Syncing the MLflow UI."
@rsync -rvu --exclude node_modules --exclude .git ui/fasttrackml-ui-mlflow/ $(MLFLOW_BUILD_LOCATION)
@echo ">>> Starting the MLflow UI."
@cd $(MLFLOW_BUILD_LOCATION)/src && yarn install --immutable && yarn start
77 changes: 25 additions & 52 deletions docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,73 +52,46 @@ the packages in `database/migrations`.

## Working with the UIs

FastTrackML incorporates the existing Aim and MLFlow web UIs, albeit with a few
modifications. This is accomplished at build time by importing the
`fasttrackml-ui-aim` and `fasttrackml-ui-mlflow` modules. These repos contain
the patched and compiled UI assets of the upstream repos at specific tagged
revisions. To make a UI change, a PR is merged to the appropriate release branch
and new tag is pushed. At that point, the `fasttrackml` reference can be updated
(in `go.mod`) to pull in the new tag.
FastTrackML incorporates the existing Aim and MLFlow web UIs, albeit
with a few modifications. This is accomplished by importing the
`fasttrackml-ui-aim` and `fasttrackml-ui-mlflow` go modules. The
corresponding repos contain the patched and compiled UI assets of the
upstream repos. To make a UI change, a PR is merged to the appropriate
release branch and a new tag is pushed. At that point, the
`fasttrackml` reference can be updated (in `go.mod`) to pull in the
new tag with your changes.

For UI development, you'll need a tighter change/view loop, so we recommend the
following approach.

Prerequisites:

- Go 1.20 or higher
- [Docker](https://docs.docker.com/get-docker/)

Steps:

1. Clone the UI repos as siblings to your `fasttrackml` working copy.

```bash
cd ..
# This is the repo for the Aim UI
git clone https://github.com/G-Research/fasttrackml-ui-aim.git
# This is the repo for the MLFlow UI
git clone https://github.com/G-Research/fasttrackml-ui-mlflow.git
```

2. Change the UI working copies to their latest release branch.
1. Fetch the UI repo submodules in your working copy of FastTrackML:

```bash
for repo in fasttrackml-ui-*; do
pushd $repo
git checkout release/$(cat upstream.txt)
popd
done
git submodule update --init --recursive
```

3. In the `fasttrackml` folder, use `go work` to map the UI working copy you
will work on as a go module replacement (we use the Aim UI in this example):
2. Update the UI submodule to the most recent release branch, and make
changes as needed:

```bash
cd fastrackml
go work init
go work use .
go work use ../fasttrackml-ui-aim
cd ui/fasttrackml-ui-aim
git fetch -a
git switch release/v3.17.5
<make edits>
```

4. Compile the UI project:
3. Run the UI development server to see your changes. Make sure the
FML tracking server is already launched, then run the ui make
target in the vscode terminal:

```bash
pushd ../fasttrackml-ui-aim
go run main.go
popd
cd <fasttrackml project root>
make ui-aim-start
<ctrl-c to stop>
```

5. On success, the UI project will have an `embed` directory that contains the
compiled assets and that can be used directly by the main project. Just build
and launch it as usual:

```bash
make run
```

6. You should now be able to see your local working copy of the UI in your
browser. As you make changes in the UI's `/src` folder, just re-run the
compile steps and refresh your browser.
7. When ready, make a PR of your changes to the UI repo, with the merge target
set as the release branch, _not_ the `main` branch.
4. When ready, make a new branch in the submodule, commit changes, and
push to your fork. Make a PR with the merge target set as the
release branch, _not_ the `main` branch.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ replace (

require (
cloud.google.com/go/storage v1.39.1
dagger.io/dagger v0.10.2
dagger.io/dagger v0.10.3
dario.cat/mergo v1.0.0
github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/G-Research/fasttrackml-ui-aim v0.31705.17
Expand All @@ -20,7 +20,7 @@ require (
github.com/aws/aws-sdk-go-v2/config v1.27.9
github.com/aws/aws-sdk-go-v2/service/s3 v1.53.0
github.com/go-python/gpython v0.2.0
github.com/gofiber/fiber/v2 v2.52.2
github.com/gofiber/fiber/v2 v2.52.4
github.com/gofiber/template/html/v2 v2.1.1
github.com/google/uuid v1.6.0
github.com/hashicorp/golang-lru/v2 v2.0.7
Expand All @@ -34,7 +34,7 @@ require (
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
github.com/zeebo/assert v1.3.0
google.golang.org/api v0.170.0
google.golang.org/api v0.171.0
gorm.io/driver/postgres v1.5.7
gorm.io/driver/sqlite v1.4.3
gorm.io/gorm v1.25.8
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc=
cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI=
cloud.google.com/go/storage v1.39.1 h1:MvraqHKhogCOTXTlct/9C3K3+Uy2jBmFYb3/Sp6dVtY=
cloud.google.com/go/storage v1.39.1/go.mod h1:xK6xZmxZmo+fyP7+DEF6FhNc24/JAe95OLyOHCXFH1o=
dagger.io/dagger v0.10.2 h1:8q4AwKm48qAWZdY7O2NMZ3FveteDHJeM3WwmcNKZOM0=
dagger.io/dagger v0.10.2/go.mod h1:AonAYX6ZXNGsVvro4HhB/Uzsp9FU+aI41YfAEY9f5mI=
dagger.io/dagger v0.10.3 h1:MxER7Zal7uk+Zi1SjXjea00T62RaISibRzWcsIie/Wo=
dagger.io/dagger v0.10.3/go.mod h1:AonAYX6ZXNGsVvro4HhB/Uzsp9FU+aI41YfAEY9f5mI=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/99designs/gqlgen v0.17.31 h1:VncSQ82VxieHkea8tz11p7h/zSbvHSxSDZfywqWt158=
Expand Down Expand Up @@ -105,8 +105,8 @@ github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gofiber/fiber/v2 v2.52.2 h1:b0rYH6b06Df+4NyrbdptQL8ifuxw/Tf2DgfkZkDaxEo=
github.com/gofiber/fiber/v2 v2.52.2/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ=
github.com/gofiber/fiber/v2 v2.52.4 h1:P+T+4iK7VaqUsq2PALYEfBBo6bJZ4q3FP8cZ84EggTM=
github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ=
github.com/gofiber/template v1.8.3 h1:hzHdvMwMo/T2kouz2pPCA0zGiLCeMnoGsQZBTSYgZxc=
github.com/gofiber/template v1.8.3/go.mod h1:bs/2n0pSNPOkRa5VJ8zTIvedcI/lEYxzV3+YPXdBvq8=
github.com/gofiber/template/html/v2 v2.1.1 h1:QEy3O3EBkvwDthy5bXVGUseOyO6ldJoiDxlF4+MJiV8=
Expand Down Expand Up @@ -379,8 +379,8 @@ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSm
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o=
gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY=
google.golang.org/api v0.170.0 h1:zMaruDePM88zxZBG+NG8+reALO2rfLhe/JShitLyT48=
google.golang.org/api v0.170.0/go.mod h1:/xql9M2btF85xac/VAm4PsLMTLVGUOpq4BE9R8jyNy8=
google.golang.org/api v0.171.0 h1:w174hnBPqut76FzW5Qaupt7zY8Kql6fiVjgys4f58sU=
google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
Expand Down
1 change: 1 addition & 0 deletions ui/fasttrackml-ui-aim
Submodule fasttrackml-ui-aim added at 8e547d
1 change: 1 addition & 0 deletions ui/fasttrackml-ui-mlflow
Submodule fasttrackml-ui-mlflow added at 11da6c

0 comments on commit 769970b

Please sign in to comment.