Skip to content

Commit 078c415

Browse files
authored
Merge pull request #109 from oslabs-beta/dev
Merge dev to main
2 parents 83f6876 + 8719cde commit 078c415

File tree

117 files changed

+24939
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+24939
-9
lines changed

.github/workflows/mlflow-js.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: mlflow
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build-and-test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Use Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '22.7'
18+
19+
- name: Install dependencies
20+
working-directory: ./mlflow
21+
run: npm ci
22+
23+
- name: Eslint
24+
working-directory: ./mlflow
25+
run: npm run lint
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Run MLflow server
31+
run: |
32+
docker run -d -p 5002:5002 --name mlflow-container ghcr.io/mlflow/mlflow:latest mlflow server --host 0.0.0.0 --port 5002
33+
sleep 30
34+
35+
- name: Run tests
36+
working-directory: ./mlflow
37+
run: npm run test
38+
39+
- name: Stop MLflow server
40+
run: docker stop mlflow-container
41+
42+
- name: Build
43+
working-directory: ./mlflow
44+
run: npm run build

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contribution Guidelines
2+
3+
We are always open to accepting any potential contributions. Here is how you can contribute:
4+
5+
1. Fork the repository
6+
2. Clone your forked repository
7+
8+
```bash
9+
git clone https://github.com/your-username/repository-name.git
10+
```
11+
12+
3. Create your feature branch
13+
14+
```bash
15+
git checkout -b feature/AmazingFeature
16+
```
17+
18+
4. Install dependencies for both mlflow and mlflow-site directories
19+
20+
```bash
21+
cd /mlflow && npm install
22+
cd ../mlflow-site && npm install
23+
```
24+
25+
5. Start the MLflow Tracking Server
26+
27+
```bash
28+
cd ../mlflow && npm run docker
29+
```
30+
31+
This will launch the MLflow UI on your local machine at `http://localhost:5001`.
32+
33+
6. Make your changes
34+
35+
7. Run ESLint to check code style
36+
37+
```bash
38+
npm run lint
39+
```
40+
41+
8. Run tests to ensure your changes don't break existing functionality
42+
43+
(Make sure you have mlflow UI server running on port 5002. We set 5002 as our default port for testing.)
44+
45+
```bash
46+
cd /mlflow && npm run dockerTest # Run this in a separate terminal
47+
npm run test
48+
```
49+
50+
This will launch the MLflow UI on your local machine at `http://localhost:5002`, and run the Jest tests.
51+
52+
9. Add and commit your changes
53+
54+
If the tests all pass:
55+
56+
```bash
57+
git add .
58+
git commit -m 'Add AmazingFeature'
59+
```
60+
61+
10. Push to the branch
62+
63+
```bash
64+
git push origin feature/AmazingFeature
65+
```
66+
67+
11. Open a Pull Request
68+
69+
**Note:** Please ensure your code adheres to our style guidelines and includes appropriate documentation for any new features.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Open Source Labs Beta
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,178 @@
1+
<div style="text-align: center">
2+
<img src="/mlflow-site/public/assets/mlflow-js-logo-whitebg.png" width=600px;"/></div>
13

4+
<br>
5+
6+
## About
7+
8+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](/LICENSE)
9+
![Release](https://img.shields.io/badge/Release-v1.0.1-426B20)
10+
![Build](https://img.shields.io/badge/Build-Passing-brightgreen.svg)
11+
![Coverage](https://img.shields.io/badge/Coverage-87%25-c7ea46.svg)
12+
[![Contributions](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg)](/CONTRIBUTING.md)
13+
14+
<i>MLflow.js</i> is an open-source JavaScript library that helps developers track machine learning experiments and manage models with MLflow, providing functionalities for machine learning lifecycle in JavaScript/TypeScript environments.
15+
16+
<br>
17+
18+
## Features
19+
20+
<i>MLflow.js</i> covers all REST API endpoints under MLflow's Tracking Server and Model Registry. Moreover, high-level abstractions have been developed to facilitate developers' common ML workflows. It provides some key advantages:
21+
22+
- Native JavaScript Integration: Seamlessly integrate MLflow capabilities within JavaScript codebases
23+
- Type Safety: Built with TypeScript for enhanced developer experience and code reliability
24+
- Modular Architecture: Designed with object-oriented structure that mirrors MLflow's concepts while being extensible and maintainable
25+
- Client-side ML Compatibility: Complements popular JavaScript libraries like TensorFlow.js, enabling ML deployment directly in the browser or client side
26+
27+
<br>
28+
29+
## Built with
30+
31+
[![TypeScript](https://img.shields.io/badge/TypeScript-0077B5?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
32+
[![JavaScript](https://img.shields.io/badge/JavaScript-000435?style=for-the-badge&logo=javascript&logoColor=00fff)](https://www.javascript.com/)
33+
[![React](https://img.shields.io/badge/React-36454F?style=for-the-badge&logo=React&logoColor=00fff)](https://react.dev/)
34+
[![Next.js](https://img.shields.io/badge/Next.js-24292e?style=for-the-badge&logo=next.js&logoColor=00fff)](https://nextjs.org/)
35+
[![TailwindCSS](https://img.shields.io/badge/Tailwind_CSS-008080?style=for-the-badge&logo=tailwindcss&logoColor=bfffff)](https://tailwindcss.com/)
36+
[![ESLINT](https://img.shields.io/badge/ESLINT-4B32C3?style=for-the-badge&logo=eslint&logoColor=bfffff)](https://eslint.org/)
37+
[![Node.js](https://img.shields.io/badge/Node.js-339933?style=for-the-badge&logo=node.js&logoColor=ffffff)](https://nodejs.org/en/)
38+
[![Jest](https://img.shields.io/badge/Jest-800020?style=for-the-badge&logo=jest&logoColor=00fff)](https://jestjs.io/)
39+
[![GitHub Actions](https://img.shields.io/badge/GitHub_Actions-30363d?style=for-the-badge&logo=github&logoColor=00fff)](https://github.com/features/actions)
40+
[![Docker](https://img.shields.io/badge/Docker-lightblue?style=for-the-badge&logo=Docker&logoColor=00fff)](https://www.docker.com/)
41+
[![NPM](https://img.shields.io/badge/NPM-CC3534?style=for-the-badge&logo=npm&logoColor=00fff)](https://www.npmjs.com/)
42+
[![Vercel](https://img.shields.io/badge/Vercel-966FD6?style=for-the-badge&logo=Vercel&logoColor=00fff)](https://vercel.com/)
43+
44+
<br>
45+
46+
## Prerequisites
47+
48+
### Set Up MLflow
49+
50+
Ensure MLflow is installed on your system:
51+
52+
```bash
53+
pip install mlflow
54+
```
55+
56+
**Note:** MLflow is compatible with MacOS. If you encounter issues with the default system Python, consider installing Python 3 via the Homebrew package manger using `brew install python`. In this case, installing MLflow is now `pip3 install mlflow`.
57+
58+
### Start the MLflow Tracking Server
59+
60+
To start the MLflow tracking server locally, use the following command:
61+
62+
```bash
63+
mlflow ui --port 5001
64+
```
65+
66+
This will launch the MLflow UI on your local machine at `http://localhost:5001`.
67+
68+
### Alternative Docker approach to the MLflow Tracking Server
69+
70+
Install [Docker Desktop](https://www.docker.com/).
71+
72+
To start the MLflow tracking server locally, use the following commands:
73+
74+
```bash
75+
docker pull ghcr.io/mlflow/mlflow
76+
docker run -p 5001:5001 ghcr.io/mlflow/mlflow:latest mlflow server --host 0.0.0.0 --port 5001
77+
```
78+
79+
This will launch the MLflow UI on your local machine at `http://localhost:5001`.
80+
81+
### Development Setup
82+
83+
For development environment setup instructions, please refer to our [Contributing Guide](/CONTRIBUTING.md).
84+
85+
<br>
86+
87+
## Quickstart
88+
89+
### Install <i>mlflow.js</i> Library
90+
91+
To use the <i>mlflow.js</i> library, navigate to your project directory and install it via npm:
92+
93+
```bash
94+
npm install mlflow-js
95+
```
96+
97+
### Usage Example
98+
99+
Here is an example of how to use the <i>mlflow.js</i> library to create an experiment:
100+
101+
```JavaScript
102+
import Mlflow from 'mlflow-js';
103+
104+
// Initialize the MLflow client
105+
const mlflow = new Mlflow(process.env.MLFLOW_TRACKING_URI);
106+
107+
// Create a new experiment
108+
async function createExperiment(){
109+
await mlflow.createExperiment('My Experiment');
110+
console.log('Experiment created successfully');
111+
}
112+
113+
createExperiment();
114+
115+
```
116+
117+
<br>
118+
119+
## Resources
120+
121+
- [Example Repository](https://github.com/oslabs-beta/mlflow-js/tree/dev/mlflow/examples) - Practical examples demonstrating <i>MLflow.js</i>'s functionality
122+
- [Quick Tutorials](https://www.mlflow-js.org/) - Video walkthrough of the example code with MLflow UI
123+
- [Read our Medium Article](link) - Overview on why we built <i>MLflow.js</i> and how it enhances ML workflows in JavaScript environments
124+
125+
<br>
126+
127+
## Documentation
128+
129+
Official documentation for <i>MLflow.js</i> can be found <a href="https://www.mlflow-js.org/documentation">here</a>.
130+
131+
### High-Level Workflows
132+
133+
**Experiment Manager**
134+
135+
- runExistingExperiment - Full workflow of creating, naming, and starting a run under an existing experiment, logging metrics, params, tags, and the model, and finishing the run
136+
- runNewExperiment - Full workflow of creating, naming, and starting a run under a new experiment, logging metrics, params, tags, and the model, and finishing the run
137+
- experimentSummary - Returns an array of all the passed-in experiment's runs, sorted according to the passed-in metric
138+
139+
**Run Manager**
140+
141+
- cleanupRuns - Deletes runs that do not meet certain criteria and return an object of deleted runs and details
142+
- copyRun - Copies a run from one experiment to another (without artifacts and models)
143+
144+
**Model Manager**
145+
146+
- createRegisteredModelWithVersion - Creates a new registered model and the first version of that model
147+
- updateRegisteredModelDescriptionAndTag - Updates a registered model's description and tags
148+
- updateAllLatestModelVersion - Updates the latest version of the specified registered model's description, adds a new alias, and tag key/value for the latest version
149+
- setLatestModelVersionTag - Adds a new tag key/value for the latest version of the specified registered model
150+
- setLatestModelVersionAlias - Adds an alias for the latest version of the specified registered model
151+
- updateLatestModelVersion - Updates the description of the latest version of a registered model
152+
- updateAllModelVersion - Updates the specified version of the specified registered model's description and adds a new alias and tag key/value for that specified version
153+
- deleteLatestModelVersion - Deletes the latest version of the specified registered model
154+
- createModelFromRunWithBestMetric - Creates a new model with the specified model name from the run with the best specified metric
155+
156+
<br>
157+
158+
## Contributing
159+
160+
We welcome contributions to <i>MLflow.js</i>! Please see our [Contributing Guide](/CONTRIBUTING.md) for more details on how to get started.
161+
162+
<br>
163+
164+
## License
165+
166+
[MIT License](/LICENSE)
167+
168+
<br>
169+
170+
## Meet The Team
171+
172+
| Name | GitHub | LinkedIn |
173+
| -------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
174+
| Yiqun Zheng | [![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github)](https://github.com/yiqunzheng) | [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/yiqunzheng/) |
175+
| Kyler Chiago | [![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github)](https://github.com/Kyler-Chiago) | [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kyler-chiago/) |
176+
| Austin Fraser | [![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github)](https://github.com/austinbfraser) | [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](http://www.linkedin.com/in/austin-fraser) |
177+
| Stephany Ho | [![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github)](https://github.com/seneyu) | [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/stephanyho/) |
178+
| Winston Ludlam | [![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github)](https://github.com/winjolu/) | [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/wjludlam/) |

license.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

mlflow-site/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["next/core-web-vitals", "next/typescript"]
3+
}

mlflow-site/.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
../.DS_Store
22+
*.pem
23+
24+
# debug
25+
npm-debug.log*
26+
yarn-debug.log*
27+
yarn-error.log*
28+
29+
# local env files
30+
.env*.local
31+
32+
# vercel
33+
.vercel
34+
35+
# typescript
36+
*.tsbuildinfo
37+
next-env.d.ts

mlflow-site/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Getting Started
2+
3+
First, run the development server:
4+
5+
```bash
6+
npm run dev
7+
# or
8+
yarn dev
9+
# or
10+
pnpm dev
11+
# or
12+
bun dev
13+
```
14+
15+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

mlflow-site/next.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
images: {
4+
remotePatterns: [
5+
{
6+
protocol: 'https',
7+
hostname: 'i.giphy.com'
8+
},
9+
],
10+
},
11+
};
12+
13+
export default nextConfig;

0 commit comments

Comments
 (0)