Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc changes #173

Merged
merged 56 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
41e9e8e
Update step-by-step.md
varkha-d-sharma Apr 29, 2024
85e61b9
Update cmf-server.md
AyeshaSanadi Apr 29, 2024
35a2bd2
Update step-by-step.md
AyeshaSanadi Apr 29, 2024
b053d9f
Update cmf_client.md
AyeshaSanadi Apr 29, 2024
3912a5e
Update step-by-step.md
AyeshaSanadi Apr 29, 2024
dbd0a04
Update Getting Started with cmf.md
AyeshaSanadi Apr 29, 2024
4469413
Update cmf_client.md
AyeshaSanadi Apr 29, 2024
7b90f44
Update cmf_client.md
AyeshaSanadi Apr 29, 2024
51add82
Update step-by-step.md
AyeshaSanadi Apr 29, 2024
b1c13dc
Update cmf-server.md
AyeshaSanadi Apr 29, 2024
25b2daf
Update index.md
AyeshaSanadi Apr 30, 2024
b36e68b
Update index.md
AyeshaSanadi Apr 30, 2024
88a6b39
Update step-by-step.md
AyeshaSanadi Apr 30, 2024
54dda23
Update step-by-step.md
AyeshaSanadi Apr 30, 2024
4116e09
Merge branch 'HewlettPackard:master' into doc_changes
varkha-d-sharma Apr 30, 2024
eb3cd94
Update index.md
AyeshaSanadi May 2, 2024
17d78ac
Update step-by-step.md
AyeshaSanadi May 2, 2024
c12ec74
Update mkdocs.yaml
AyeshaSanadi May 2, 2024
ce90d67
Update cmf-server.md
AyeshaSanadi May 2, 2024
c7c2be7
Update step-by-step.md
AyeshaSanadi May 2, 2024
68b09dc
Update index.md
AyeshaSanadi May 2, 2024
9fa822d
Update cmf-server.md
AyeshaSanadi May 2, 2024
d0f4c86
Update step-by-step.md
AyeshaSanadi May 2, 2024
0e78002
Update step-by-step.md
AyeshaSanadi May 2, 2024
36616b4
Update minio-server.md
AyeshaSanadi May 2, 2024
0a8cf75
Update cmf_client.md
AyeshaSanadi May 2, 2024
8e35fd4
Update cmf-server.md
AyeshaSanadi May 2, 2024
56bc07f
Update index.md
AyeshaSanadi May 2, 2024
d25ac66
Update index.md
AyeshaSanadi May 2, 2024
4d9e9cd
Update minio-server.md
AyeshaSanadi May 2, 2024
688628f
Update cmf-server.md
AyeshaSanadi May 2, 2024
0e2adee
Update cmf-server.md
AyeshaSanadi May 2, 2024
810afd1
Update cmf-server.md
AyeshaSanadi May 2, 2024
1fb6091
Update cmf-server.md
AyeshaSanadi May 2, 2024
fe69d9d
Update cmf-server.md
AyeshaSanadi May 2, 2024
991d400
Update cmf-server.md
AyeshaSanadi May 2, 2024
2ada89f
Update cmf-server.md
AyeshaSanadi May 2, 2024
9c9e7c8
Update cmf-server.md
AyeshaSanadi May 2, 2024
d713e3e
Update cmf-server.md
AyeshaSanadi May 2, 2024
95166b3
Update cmf-server.md
AyeshaSanadi May 2, 2024
0a006d7
Update cmf-server.md
AyeshaSanadi May 2, 2024
ff16906
Update cmf-server.md
AyeshaSanadi May 2, 2024
fe5f3ca
Update cmf-server.md
AyeshaSanadi May 2, 2024
8eb5e74
Update cmf-server.md
AyeshaSanadi May 2, 2024
3ea294d
Update cmf-server.md
AyeshaSanadi May 2, 2024
203e50f
Update cmf-server.md
AyeshaSanadi May 2, 2024
7d9ee47
Update cmf-server.md
AyeshaSanadi May 2, 2024
1a47af6
Update cmf-server.md
AyeshaSanadi May 2, 2024
8b6ef35
Update cmf-server.md
AyeshaSanadi May 2, 2024
9e8c77a
Update cmf-server.md
AyeshaSanadi May 2, 2024
c4c3a68
Update minio-server.md
AyeshaSanadi May 2, 2024
efe7ba2
Update cmf_client.md
AyeshaSanadi May 8, 2024
ef0dc9f
Update cmf_client.md
AyeshaSanadi May 9, 2024
a2b8d60
Update cmf_client.md
AyeshaSanadi May 9, 2024
158ea56
Merge branch 'HewlettPackard:master' into doc_changes
varkha-d-sharma May 10, 2024
d0f104e
Added python handler
May 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cmf_client/Getting Started with cmf.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ mkdir example-folder

CMF initialization is the first and foremost to use cmf-client commads. This command in one go complete initialization process making cmf-client user friendly. Execute `cmf init` in the `example-folder` directory created in the [above](#create-a-folder) step.
```
cmf init minioS3 --url s3://bucket-name --endpoint-url http://localhost:9000 --access-key-id minioadmin --secret-key minioadmin --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-ip http://x.x.x.x:8080 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://X.X.X.X:7687
cmf init minioS3 --url s3://bucket-name --endpoint-url http://localhost:9000 --access-key-id minioadmin --secret-key minioadmin --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://x.x.x.x:8080 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://X.X.X.X:7687
```
Check [here](./cmf_client.md) for more details.

Expand Down
69 changes: 57 additions & 12 deletions docs/cmf_client/cmf_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Usage: cmf init minioS3 [-h] --url [url]
```
`cmf init minioS3` configures Minio S3 bucket as a cmf artifact repository. Refer [minio-server.md](./minio-server.md#steps-to-set-up-a-minio-server) to set up a minio server.
```
cmf init minioS3 --url s3://bucket-name --endpoint-url http://localhost:9000 --access-key-id minioadmin --secret-key minioadmin --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://127.0.0.1:80 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
cmf init minioS3 --url s3://dvc-art --endpoint-url http://x.x.x.x:9000 --access-key-id minioadmin --secret-key minioadmin --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://x.x.x.x:8080 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
```
> Here, "dvc-art" is provided as an example bucket name. However, users can change it as needed, if the user chooses to change it, they will need to update the Dockerfile for MinIOS3 accordingly.

Required Arguments
```
--url [url] Specify bucket url.
Expand Down Expand Up @@ -55,8 +57,11 @@ Usage: cmf init local [-h] --path [path] -
```
`cmf init local` initialises local directory as a cmf artifact repository.
```
cmf init local --path /home/user/local-storage --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://127.0.0.1:80 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
cmf init local --path /home/XXXX/local-storage --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://x.x.x.x:8080 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
```

> Replace 'XXXX' with your system username in the following path: /home/XXXX/local-storage

Required Arguments
```
--path [path] Specify local directory path.
Expand All @@ -71,20 +76,59 @@ Optional Arguments
--neo4j-uri <neo4j_uri> Specify neo4j uri. Eg bolt://localhost:7687 (default: None)
```
### cmf init amazonS3
Before setting up, obtain AWS temporary security credentials using the AWS Security Token Service (STS). These credentials are short-term and can last from minutes to hours. They are dynamically generated and provided to trusted users upon request, and expire after use. Users with appropriate permissions can request new credentials before or upon expiration. For further information, refer to the [Temporary security credentials in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) page.

To retrieve temporary security credentials using multi-factor authentication (MFA) for an IAM user, you can use the below command.
```
aws sts get-session-token --duration-seconds <duration> --serial-number <MFA_device_serial_number> --token-code <MFA_token_code>
```
Required Arguments
```
--serial-number Specifies the serial number of the MFA device associated with the IAM user.
--token-code Specifies the one-time code generated by the MFA device.
```

Optional Arguments
```
--duration-seconds Specifies the duration for which the temporary credentials will be valid, in seconds.
```

Example
```
aws sts get-session-token --duration-seconds 3600 --serial-number arn:aws:iam::123456789012:mfa/user --token-code 123456
```

This will return output like

```
{
"Credentials": {
"AccessKeyId": "ABCDEFGHIJKLMNO123456",
"SecretAccessKey": "PQRSTUVWXYZ789101112131415",
"SessionToken": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijlmnopqrstuvwxyz12345678910ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijlmnopqrstuvwxyz12345678910ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijlmnopqrstuvwxyz12345678910",
"Expiration": "2021-05-10T15:31:08+00:00"
}
}
```
Initialization of amazonS3
```
Usage: cmf init amazonS3 [-h] --url [url]
--access-key-id [access_key_id]
--secret-key [secret_key]
--git-remote-url [git_remote_url]
--secret-key [secret_key]
--session-token [session_token]
--git-remote-url [git_remote_url]
--cmf-server-url [cmf_server_url]
--neo4j-user [neo4j_user]
--neo4j-password neo4j_password]
--neo4j-uri [neo4j_uri]
```
`cmf init amazonS3` initialises Amazon S3 bucket as a CMF artifact repository.
```
cmf init amazonS3 --url s3://bucket-name --access-key-id XXXXXXXXXXXXX --secret-key XXXXXXXXXXXXX --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://127.0.0.1:80 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
cmf init amazonS3 --url s3://bucket-name --access-key-id XXXXXXXXXXXXX --secret-key XXXXXXXXXXXXX --session-token XXXXXXXXXXXXX --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://x.x.x.x:8080 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
```
> Here, use the --access-key-id, --secret-key and --session-token generated from the `aws sts` command which is mentioned above.

> The bucket-name must exist within Amazon S3 before executing the `cmf artifact push` command.

Required Arguments
```
Expand All @@ -96,6 +140,7 @@ Required Arguments
Optional Arguments
```
-h, --help show this help message and exit
--session-token Specify session token. (default: )
--cmf-server-url [cmf_server_url] Specify cmf-server url. (default: http://127.0.0.1:80)
--neo4j-user [neo4j_user] Specify neo4j user. (default: None)
--neo4j-password [neo4j_password] Specify neo4j password. (default: None)
Expand All @@ -114,7 +159,7 @@ Usage: cmf init sshremote [-h] --path [path]
```
`cmf init sshremote` command initialises remote ssh directory as a cmf artifact repository.
```
cmf init sshremote --path ssh://127.0.0.1/home/user/ssh-storage --user XXXXX --port 22 --password example@123 --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://127.0.0.1:80 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
cmf init sshremote --path ssh://127.0.0.1/home/user/ssh-storage --user XXXXX --port 22 --password example@123 --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://x.x.x.x:8080 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
```
Required Arguments
```
Expand Down Expand Up @@ -144,7 +189,7 @@ Usage: cmf artifact pull [-h] -p [pipeline_name] -f [file_name] [-a <artifact_na
```
`cmf artifact pull` command pull artifacts from the user configured repository to the user's local machine.
```
cmf artifact pull -p 'Test-env'
cmf artifact pull -p 'pipeline-name'
```
Required Arguments
```
Expand All @@ -153,7 +198,7 @@ Required Arguments
Optional Arguments
```
-h, --help show this help message and exit
-a <artifact_name>, --artifact_name <artifact_name> Specify artifact name.
-a <artifact_name>, --artifact_name <artifact_name> Specify artifact name only; don't use folder name or absolute path.
-f [file_name],--file-name [file_name] Specify mlmd file name.
```
### cmf artifact push
Expand All @@ -175,7 +220,7 @@ Usage: cmf metadata pull [-h] -p [pipeline_name] -f [file_name] -e [exec_id]
```
`cmf metadata pull` command pulls the metadata file from the cmf-server to the user's local machine.
```
cmf metadata pull -p 'Test-env' -f "/home/user/example/name_of_file"
cmf metadata pull -p 'pipeline-name' -f "/path/to/mlmd-file-name"
```
Required Arguments
```
Expand All @@ -184,7 +229,7 @@ Required Arguments
Optional Arguments
```
-h, --help show this help message and exit
-e [exec_id], --execution [exec_name] Specify execution id
-e [exec_id], --execution [exec_id] Specify execution id
-f [file_name], --file_name [file_name] Specify mlmd file name with full path(either relative or absolute).
```
### cmf metadata push
Expand All @@ -193,7 +238,7 @@ Usage: cmf metadata push [-h] -p [pipeline_name] -f [file_name] -e [exec_id]
```
`cmf metadata push` command pushes the metadata file from the local machine to the cmf-server.
```
cmf metadata push -p 'Test-env' -f "/home/user/example/name_of_file"
cmf metadata push -p 'pipeline-name' -f "/path/to/mlmd-file-name"
```
Required Arguments
```
Expand All @@ -204,5 +249,5 @@ Optional Arguments
```
-h, --help show this help message and exit
-f [file_name], --file_name [file_name] Specify mlmd file name.
-e [exec_name], --execution [exec_name] Specify execution id.
-e [exec_id], --execution [exec_id] Specify execution id.
```
4 changes: 3 additions & 1 deletion docs/cmf_client/minio-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ Follow the below mentioned steps to set up a MinIO server:

3. Execute the following command to initialize the MinIO S3 bucket as a CMF artifact repository.
```
cmf init minioS3 --url s3://bucket-name --endpoint-url http://localhost:9000 --access-key-id minioadmin --secret-key minioadmin --git-remote-url https://github.com/user/experiment-repo.git
cmf init minioS3 --url s3://dvc-art --endpoint-url http://x.x.x.x:9000 --access-key-id minioadmin --secret-key minioadmin --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://x.x.x.x:8080 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
```

> Here, "dvc-art" is provided as an example bucket name. However, users can change it as needed, if the user chooses to change it, they will need to update the Dockerfile for minioS3 accordingly.

4. Execute `cmf init show` to check the CMF configuration. The sample output looks as follows:
```
Expand Down
57 changes: 29 additions & 28 deletions docs/cmf_client/step-by-step.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
# Getting started with cmf
# Quick start with cmf-client
Common metadata framework (cmf) has the following components:

- **Metadata Library** exposes API’s to track the pipeline metadata. It also provides API’s to query the stored metadata.
- **cmf-client** interacts with the server to pull or push metadata from or to the cmf-server.
- **cmf-server** interacts with all the remote clients and is responsible to merge the metadata transferred by the cmf-client and manage the consolidated metadata.
- **Central Artifact Repositories** hosts the code and data.

## Install cmf library i.e. cmflib
Before proceeding, ensure that the CMF library is installed on your system. If not, follow the installation instructions provided inside the [CMF in a nutshell](../index.md) page.

## Install cmf-server
cmf-server is a key interface for the user to explore and track their ML training runs. It allows users to store the metadata file on the cmf-server. The user can retrieve the saved metadata file and can view the content of the saved metadata file using the UI provided by the cmf-server.

Follow the instructions on the [Getting started with cmf-server](../cmf_server/cmf-server.md) page for details on how to setup a cmf-server.

## Setup a cmf-client
cmf-client is a tool that facilitates metadata collaboration between different teams or two team members. It allows users to pull or push metadata from or to the cmf-server.

Follow the below-mentioned steps for the end-to-end setup of cmf-client:-

**Pre-Requisites**

- Python 3.8+
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we get rid of python version ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have reorganized the pages. On the main page (i.e., 'CMF in a Nutshell'), we have included all the installation steps for the CMF library, as shown in the image below.
Screenshot from 2024-05-10 11-54-31

In the 'Getting Started with the CMF Client' page, we have specified that the CMF server and client should be installed after configuring the CMF library, for which installation steps are provided on the main page.
Screenshot from 2024-05-10 11-56-34

- Git latest version
**Configuration**

**Install cmf library i.e. cmflib**
```
pip install git+https://github.com/HewlettPackard/cmf
```
**OR**
```
pip install cmflib
```
Check [here](https://hewlettpackard.github.io/cmf/) for more details.
1. Create working directory `mkdir <workdir>`
2. Execute `cmf init` to configure dvc remote directory, git remote url, cmf server and neo4j. Follow the [Overview](./cmf_client.md) page for more details.

## Install cmf-server
cmf-server is a key interface for the user to explore and track their ML training runs. It allows users to store the metadata file on the cmf-server. The user can retrieve the saved metadata file and can view the content of the saved metadata file using the UI provided by the cmf-server.

Follow [here](../cmf_server/cmf-server.md) for details on how to setup a cmf-server.

## How to effectively use cmf-client?

Expand All @@ -42,37 +37,43 @@ mkdir example-folder

**Initialize cmf**

CMF initialization is the first and foremost to use cmf-client commads. This command in one go complete initialization process making cmf-client user friendly. Execute `cmf init` in the `example-folder` directory created in the [above](#create-a-folder) step.
CMF initialization is the first and foremost to use cmf-client commads. This command in one go complete initialization process making cmf-client user friendly. Execute `cmf init` in the `example-folder` directory created in the above step.
```
cmf init minioS3 --url s3://bucket-name --endpoint-url http://localhost:9000 --access-key-id minioadmin --secret-key minioadmin --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-ip http://x.x.x.x:8080 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://X.X.X.X:7687
cmf init minioS3 --url s3://dvc-art --endpoint-url http://x.x.x.x:9000 --access-key-id minioadmin --secret-key minioadmin --git-remote-url https://github.com/user/experiment-repo.git --cmf-server-url http://x.x.x.x:8080 --neo4j-user neo4j --neo4j-password password --neo4j-uri bolt://localhost:7687
```
Check [here](./cmf_client.md) for more details.
> Here, "dvc-art" is provided as an example bucket name. However, users can change it as needed, if the user chooses to change it, they will need to update the Dockerfile for minioS3 accordingly.

Check [Overview](./cmf_client.md) page for more details.

**Check status of CMF initialization (Optional)**
```
cmf init show
```
Check [here](./cmf_client.md) for more details.
Check [Overview](./cmf_client.md) page for more details.

**Track metadata using cmflib**

Use [Sample projects](https://github.com/HewlettPackard/cmf/tree/master/examples) as a reference to create a new project to track metadata for ML pipelines.
Use [Sample projects](https://github.com/HewlettPackard/cmf/blob/master/examples/example-get-started/README.md) as a reference to create a new project to track metadata for ML pipelines.

More information is available inside [Getting Started](https://hewlettpackard.github.io/cmf/examples/getting_started/).


> Before pushing artifacts or metadata, ensure that the cmf server and minioS3 are up and running.

More info is available [here](https://hewlettpackard.github.io/cmf/examples/getting_started/).

**Push artifacts**

Push artifacts in the artifact repo initialised in the [Initialize cmf](#initialize-cmf) step.
```
cmf artifact push
```
Check [here](./cmf_client.md) for more details.
Check [Overview](./cmf_client.md) page for more details.

**Push metadata to cmf-server**
```
cmf metadata push -p 'Test-env'
```
Check [here](./cmf_client.md) for more details.
Check [Overview](./cmf_client.md) page for more details.

### cmf-client with collaborative development
In the case of collaborative development, in addition to the above commands, users can follow the commands below to pull metadata and artifacts from a common cmf server and a central artifact repository.
Expand All @@ -83,15 +84,15 @@ Execute `cmf metadata` command in the `example_folder`.
```
cmf metadata pull -p 'Test-env'
```
Check [here](./cmf_client.md) for more details.
Check [Overview](./cmf_client.md) page for more details.

**Pull artifacts from the central artifact repo**

Execute `cmf artifact` command in the `example_folder`.
```
cmf artifact pull -p "Test-env"
cmf artifact pull -p 'Test-env'
```
Check [here](./cmf_client.md) for more details.
Check [Overview](./cmf_client.md) page for more details.

## Flow Chart for cmf
<img src="./../../assets/flow_chart_cmf.jpg" alt="Flow chart for cmf" style="display: block; margin: 0 auto" />
Loading