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

support rename collection #173

Merged
merged 7 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
128 changes: 54 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,37 @@ Attu is an all-in-one milvus administration tool. With Attu, you can dramaticall

## Features

- Basic dashboard
- View basic collection statistics
- Quick search from loaded collection
- Quick release loaded collection
- Manage collections/partitions
- Create/Drop collection/partion
- Create/drop alias
- View collection schema
- Create/drop index with parameters
- Load/release collections for search
- Data Management
- Insert entities
- Data preview
- Data query
- Vector search/query with advanced filter
- System view
- View milvus nodes system info
- View milvus nodes configuration
- Manage Milvus user
- More are comming...

## Quick start

> If you prefer desktop application, you can download the [desktop version of Attu](https://github.com/zilliztech/attu/releases/).

## Run attu from docker

> Ensure you have Milvus installed on [your server](https://milvus.io/docs/install_standalone-docker.md) or [cluster](https://milvus.io/docs/install_cluster-docker.md), and attu only supports Milvus 2.x.

> _ Before attu v2.1.0 , [check here](https://github.com/zilliztech/attu/tree/v2.0.5) _\*\*

### ✈️ Start a attu container
- Basic Dashboard: Get an overview of your collection statistics, perform quick searches, and release collections quickly.
- Collection Management: Create, drop, and manage collections using our intuitive interface. You can also create aliases, view collection schemas, and configure indexes with custom parameters.
- Data Management: Insert entities, preview your data, and run queries to analyze your results.
- Vector Search/Query: Use our advanced filtering system to search and query vectors with precision.
- System View: View system information and Milvus node configurations easily.
- Milvus User Management: Manage users and their permissions with ease.
- More Features Coming Soon: Stay tuned for additional features that will make Milvus even more powerful and user-friendly.

```code
docker run -p 8000:3000 -e MILVUS_URL={milvus server ip}:19530 zilliz/attu:latest
```
## Quick start guide for Attu

> 👀 Please make sure the attu server(container) can access the milvus ip address.
If you prefer to use a desktop application, you can download the [desktop version of Attu](https://github.com/zilliztech/attu/releases/).

Once you start the container, open the browser, type `http://{ attu ip }:8000`, you can view the attu GUI.
### Running Attu from Docker

#### Docker CLI parameters
Before you begin, make sure that you have Milvus installed on either [your server](https://milvus.io/docs/install_cluster-docker.md) or [Zilliz Cloud](https://zilliz.com/cloud). Note that Attu only supports Milvus 2.x and some of the features are not supported yet for Zilliz Cloud.

| Parameter | Example | required | description |
| :--------- | :---------------- | :------: | --------------------------- |
| MILVUS_URL | 192.168.0.1:19530 | false | Optional, Milvus server URL |
Here are the steps to start a container for running Attu:

Tip: **127.0.0.1 or localhost will not work when runs on docker**
```code
docker run -p 8000:3000 -e MILVUS_URL={milvus server IP}:19530 zilliz/attu:latest
```

## Try the dev build
Make sure that the Attu container can access the Milvus IP address. After starting the container, open your web browser and enter `http://{ Attu IP }:8000` to view the Attu GUI.

> We plan to release attu once a feature is done. Also, if you want to try the nightly build, please pull the docker image with the `dev` tag.
#### Parameters for Docker CLI

```code
docker run -p 8000:3000 -e MILVUS_URL={ your machine IP }:19530 zilliz/attu:dev
```
| Parameter | Example | Required | Description |
| :--------- | :---------------- | :------: | --------------------------- |
| MILVUS_URL | 192.168.0.1:19530 | false | Optional, Milvus server URL |

Note that "127.0.0.1" or "localhost" will not work when running Attu on Docker.

## Screenshots

Expand All @@ -78,47 +53,52 @@ docker run -p 8000:3000 -e MILVUS_URL={ your machine IP }:19530 zilliz/attu:dev

## ✨ Contributing Code

You might want to build Attu locally to contribute some code, test out the latest features, or try
out an open PR:
Thank you for your interest in contributing to Attu! Here's how you can build Attu locally to contribute code, test out the latest features, or try out an open PR:

### Build server
### Build the Server

1. Fork and clone the repo
2. `cd server` go to the server directory
3. `yarn install` to install dependencies
4. Create a branch for your PR
1. Fork and clone the Attu repository.
2. Navigate to the server directory by running `cd server` in the terminal.
3. Install dependencies by running `yarn install`.
4. To start the server in development mode, run `yarn start`.
5. Create a new branch for your PR by running `git checkout -b my-branch`.

### Build client
### Build the Client

1. Fork and clone the repo
2. `cd client` go to the client directory
3. `yarn install` to install dependencies
4. Create a branch for your PR
1. Fork and clone the Attu repository.
2. Navigate to the client directory by running `cd client` in the terminal.
3. Install dependencies by running `yarn install`.
4. To start the server in development mode, run `yarn start`.
5. Create a new branch for your PR by running `git checkout -b my-branch`.

### Milvus
### Submitting a Pull Request

New to milvus? [Milvus](https://milvus.io) is an open-source vector database built to power AI applications and embedding similarity search.
1. Make changes and ensure that tests pass.
2. Commit changes and push to your fork.
3. Create a Pull Request targeting the main branch of Attu.

### Userful links
We appreciate your contributions to Attu, regardless of size. Thanks for supporting the project!

- [Milvus docs](https://milvus.io/docs)
- [Milvus python sdk](https://github.com/milvus-io/pymilvus)
- [Milvus java sdk](https://github.com/milvus-io/milvus-sdk-java)
- [Milvus gp sdk](https://github.com/milvus-io/milvus-sdk-go)
- [Milvus node sdk](https://github.com/milvus-io/milvus-sdk-node)
- [Feder](https://github.com/zilliztech/feder)
#### ❓ Do you have any questions or problems?

#### ❓ Questions? Problems?
If you encounter any bugs or want to request a new feature, please create a [GitHub issue](https://github.com/zilliztech/attu/issues/new/choose). It's important to check if someone else has already created an issue for the same problem before submitting a new one.

- If you've found a bug or want to request a feature, please create a [GitHub Issue](https://github.com/zilliztech/attu/issues/new/choose).
Please check to make sure someone else hasn't already created an issue for the same topic.
### Userful links
Here are some helpful resources to get you started with Milvus:

[milvus-doc]: https://milvus.io/docs
- [Milvus documentation](https://milvus.io/docs): Here, you can find detailed information on how to use Milvus, including installation instructions, tutorials, and API documentation.
- [Milvus python SDK](https://github.com/milvus-io/pymilvus): The Python SDK allows you to interact with Milvus using Python. It provides a simple and intuitive interface for creating and querying vectors.
- [Milvus Java SDK](https://github.com/milvus-io/milvus-sdk-java): The Java SDK is similar to the Python SDK but designed for Java developers. It also provides a simple and intuitive interface for creating and querying vectors.
- [Milvus Go SDK](https://github.com/milvus-io/milvus-sdk-go): The Go SDK provides a Go API for Milvus. If you're a Go developer, this is the SDK for you.
- [Milvus Node SDK](https://github.com/milvus-io/milvus-sdk-node): The Node SDK provides a Node.js API for Milvus. If you're a Node.js developer, this is the SDK for you.
- [Feder](https://github.com/zilliztech/feder): Feder is a JavaScript tool designed to aid in the comprehension of embedding vectors.

## Community

💬 Community isn’t just about writing code together. Come join the conversation, share your knowledge and get your questions answered on [Milvus Slack Channel](https://join.slack.com/t/milvusio/shared_invite/zt-e0u4qu3k-bI2GDNys3ZqX1YCJ9OM~GQ)!
💬 Join our vibrant community on the Milvus Slack Channel where you can share your knowledge, ask questions and engage in meaningful conversations. It's not just about coding, it's about connecting with other like-minded individuals. Click the link below to join now!

<a href="https://join.slack.com/t/milvusio/shared_invite/zt-e0u4qu3k-bI2GDNys3ZqX1YCJ9OM~GQ">
<a href="https://slack.milvus.io/">
<img src="https://assets.zilliz.com/readme_slack_4a07c4c92f.png" alt="Miluvs Slack Channel" height="150" width="500">
</a>

Also, don't forget to check out our documentation and GitHub repositories for more resources and information. We look forward to seeing you on the channel!
16 changes: 14 additions & 2 deletions client/src/components/icons/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import FileCopyIcon from '@material-ui/icons/FileCopy';
import Visibility from '@material-ui/icons/Visibility';
import VisibilityOff from '@material-ui/icons/VisibilityOff';
import ClearIcon from '@material-ui/icons/Clear';
import EditIcon from '@material-ui/icons/Edit';
import ReorderIcon from '@material-ui/icons/Reorder';
import AppsIcon from '@material-ui/icons/Apps';
import MoreVertIcon from '@material-ui/icons/MoreVert';
Expand Down Expand Up @@ -45,7 +46,7 @@ import { ReactComponent as SystemIcon } from '../../assets/icons/system.svg';
const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
search: (props = {}) => <SearchIcon {...props} />,
add: (props = {}) => <AddIcon {...props} />,
addOutline: (props = {}) => <AddCircleOutlineIcon {...props} />,
addOutline: (props = {}) => <AddCircleOutlineIcon {...props} />,
delete: (props = {}) => <DeleteIcon {...props} />,
list: (props = {}) => <ReorderIcon {...props} />,
copy: (props = {}) => <FileCopyIcon {...props} />,
Expand All @@ -68,6 +69,7 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
alias: (props = {}) => <AlternateEmailIcon {...props} />,
datePicker: (props = {}) => <DatePicker {...props} />,
download: (props = {}) => <GetAppIcon {...props} />,
edit: (props = {}) => <EditIcon {...props} />,

zilliz: (props = {}) => (
<SvgIcon viewBox="0 0 36 36" component={ZillizIcon} {...props} />
Expand Down Expand Up @@ -108,7 +110,12 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
<SvgIcon viewBox="0 0 16 16" component={KeyIcon} {...props} />
),
upload: (props = {}) => (
<SvgIcon viewBox="0 0 16 16" component={UploadIcon} {...props} />
<SvgIcon
viewBox="0 0 16 16"
component={UploadIcon}
{...props}
fill="#000"
/>
),
vectorSearch: (props = {}) => (
<SvgIcon viewBox="0 0 48 48" component={SearchEmptyIcon} {...props} />
Expand All @@ -121,6 +128,11 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
<path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-6 10H6v-2h8v2zm4-4H6v-2h12v2z"></path>
</SvgIcon>
),
uploadFile: (props = {}) => (
<SvgIcon viewBox="0 0 24 24" {...props}>
<path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"></path>
</SvgIcon>
),
};

export default icons;
4 changes: 3 additions & 1 deletion client/src/components/icons/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ export type IconsType =
| 'alias'
| 'datePicker'
| 'download'
| 'source';
| 'source'
| 'edit'
| 'uploadFile';
4 changes: 4 additions & 0 deletions client/src/consts/Milvus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export const FLOAT_INDEX_CONFIG: indexConfigType = {
create: ['n_trees'],
search: ['search_k'],
},
// AUTOINDEX: {
// create: [],
// search: [],
// },
// RNSG: {
// create: ['out_degree', 'candidate_pool_size', 'search_length', 'knng'],
// search: ['search_length'],
Expand Down
10 changes: 10 additions & 0 deletions client/src/http/Collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ export class CollectionHttp extends BaseModel implements CollectionView {
});
}

static renameCollection(
collectionName: string,
params: { new_collection_name: string }
) {
return super.create({
path: `${this.COLLECTIONS_URL}/${collectionName}`,
data: params,
});
}

static getStatistics() {
return super.search({ path: this.COLLECTIONS_STATISTICS_URL, params: {} });
}
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/cn/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const btnTrans = {
loading: 'Loading...',
importing: 'Importing...',
example: 'Example',
rename: 'Rename',
};

export default btnTrans;
13 changes: 12 additions & 1 deletion client/src/i18n/cn/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const collectionTrans = {
create: 'Create Collection',
delete: 'delete',
deleteTooltip: 'Please select at least one item to delete.',
rename: 'rename',
renameTooltip: 'Please select one item to rename.',
newColName: 'New Collection Name',
alias: 'Alias',
aliasTooltip: 'Please select one collection to create alias',
download: 'Download',
Expand Down Expand Up @@ -58,8 +61,11 @@ const collectionTrans = {
// load dialog
loadTitle: 'Load Collection',
loadContent:
'You are trying to load a collection with data. Only loaded collection can be searched.',
'All search and query operations within Milvus are executed in memory, only loaded collection can be searched.',
loadConfirmLabel: 'Load',
replicaNum: 'Replica number',
replicaDes: `With in-memory replicas, Milvus can load the same segment on multiple query nodes. The replica number can not exceed query node count.`,
enableRepica: `Enable in-memory replica`,

// release dialog
releaseTitle: 'Release Collection',
Expand All @@ -82,6 +88,11 @@ const collectionTrans = {

// alias dialog
aliasCreatePlaceholder: 'Alias name',

// rename dialog
newColNamePlaceholder: 'New Collection Name',
newNameInfo:
'Only numbers, letters, and underscores are allowed.',
};

export default collectionTrans;
1 change: 1 addition & 0 deletions client/src/i18n/cn/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const dialogTrans = {
deleteTipAction: 'Type',
deleteTipPurpose: 'to confirm.',
deleteTitle: `Drop {{type}}`,
renameTitle: `Rename {{type}}`,
releaseTitle: `Release {{type}}`,
createAlias: `Create alias for {{type}}`,
loadTitle: `Load {{type}}`,
Expand Down
4 changes: 2 additions & 2 deletions client/src/i18n/cn/overview.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const overviewTrans = {
load: 'Loaded Collections',
all: 'All Collections',
data: 'Data',
rows: '{{number}} Entities',
data: 'Entites',
rows: '{{number}}',
loading: 'Loading Collections',
};

Expand Down
2 changes: 1 addition & 1 deletion client/src/i18n/cn/prometheus.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const prometheusTrans = {
ready: 'Prometheus is ready.',
invalid: 'Prometheus configuration is invalid.',

totalCount: 'Total Count',
searchCount: 'Search Count',
searchLatency: 'Search Latency',
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/cn/success.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const successTrans = {
delete: `{{name}} successfully dropped.`,
release: `{{name}} has been released.`,
update: `{{name}} has been updated.`,
rename: `{{name}} has been renamed.`,
};

export default successTrans;
1 change: 1 addition & 0 deletions client/src/i18n/en/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const btnTrans = {
loading: 'Loading...',
importing: 'Importing...',
example: 'Example',
rename: 'Rename',
};

export default btnTrans;
8 changes: 8 additions & 0 deletions client/src/i18n/en/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const collectionTrans = {
create: 'Create Collection',
delete: 'delete',
deleteTooltip: 'Please select at least one item to delete.',
rename: 'rename',
renameTooltip: 'Please select one item to rename.',
newColName: 'New Collection Name',
alias: 'Alias',
aliasTooltip: 'Please select one collection to create alias',
download: 'Download',
Expand Down Expand Up @@ -85,6 +88,11 @@ const collectionTrans = {

// alias dialog
aliasCreatePlaceholder: 'Alias name',

// rename dialog
newColNamePlaceholder: 'New Collection Name',
newNameInfo:
'Only numbers, letters, and underscores are allowed.',
};

export default collectionTrans;
1 change: 1 addition & 0 deletions client/src/i18n/en/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const dialogTrans = {
deleteTipAction: 'Type',
deleteTipPurpose: 'to confirm.',
deleteTitle: `Drop {{type}}`,
renameTitle: `Rename {{type}}`,
releaseTitle: `Release {{type}}`,
createAlias: `Create alias for {{type}}`,
loadTitle: `Load {{type}}`,
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/en/success.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const successTrans = {
delete: `{{name}} successfully dropped.`,
release: `{{name}} has been released.`,
update: `{{name}} has been updated.`,
rename: `{{name}} has been renamed.`,
};

export default successTrans;
Loading