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

WIP: 1155 implement project backend #1158

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b5b6762
release updates
longshuicy Jul 22, 2024
d655342
Merge branch 'main' into release/v2.0-beta-3
longshuicy Jul 24, 2024
4d136e8
1147 clowder 2 helm chart clean up (#1148)
longshuicy Jul 25, 2024
91ad4e7
turn off default extractors
longshuicy Jul 26, 2024
b3395df
initial commit new model
tcnichol Jul 29, 2024
1f73ead
adding db, out, in, etc
tcnichol Jul 29, 2024
d4c3904
save and get methods
tcnichol Jul 29, 2024
1c83600
get method
tcnichol Jul 29, 2024
a89ebbb
add users to project
tcnichol Jul 29, 2024
a15adad
adding to do
tcnichol Jul 29, 2024
f5e69b3
add a remove project member
tcnichol Jul 29, 2024
3b2cba9
routes for deleting and adding, removing members
tcnichol Jul 29, 2024
250f22a
"project" not "group"
tcnichol Jul 29, 2024
4dc5b94
methods for adding and removing datasets from projects
tcnichol Jul 30, 2024
9252bef
remove license
tcnichol Jul 30, 2024
6291cc0
adding and removing folders and files
tcnichol Jul 30, 2024
a679d7c
only add if a file, folder, dataset id not in the project already
tcnichol Jul 30, 2024
9f2c8ac
beginning project tests
tcnichol Jul 30, 2024
7a8b3d2
add test add dataset to project
tcnichol Jul 30, 2024
0bd2f4b
formatting
tcnichol Jul 30, 2024
5c508e2
adding routes to main
tcnichol Jul 30, 2024
91e14cb
get project works
tcnichol Jul 30, 2024
daf3ed0
fixing add dataset to project
tcnichol Jul 30, 2024
333f7fb
default value empty lists not none
tcnichol Jul 30, 2024
8faab21
fixing the folder part
tcnichol Jul 30, 2024
d4d8a7e
fixing filex
tcnichol Jul 30, 2024
cf1b537
add pydantic id not string
tcnichol Jul 30, 2024
67f5f40
file not folder
tcnichol Jul 30, 2024
379b605
formatting
tcnichol Jul 30, 2024
dfcdbde
Merge branch 'main' into release/v2.0-beta-3
longshuicy Aug 13, 2024
1a3df5a
Merge remote-tracking branch 'origin/release/v2.0-beta-3' into 1155-i…
tcnichol Aug 13, 2024
9fed4de
test project needs a creator
tcnichol Aug 13, 2024
4e9476e
ran pre commit
tcnichol Aug 13, 2024
7575fee
codegen
tcnichol Aug 13, 2024
36887c8
codegen
tcnichol Aug 14, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ scripts/keycloak/data/*
# ignore clowder chart deps
deployments/kubernetes/charts/clowder2/charts
deployments/kubernetes/charts/clowder2/*clowder2-software-dev.yaml
*secret*.yaml

# Environments
.env
Expand Down
7 changes: 4 additions & 3 deletions .run/Python tests in tests.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<module name="clowder2" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="SDK_HOME" value="$USER_HOME$/.virtualenvs/clowder2-Ai7Xc8E9/bin/python" />
<option name="SDK_NAME" value="Python 3.7 (clowder2-Ai7Xc8E9)" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/backend/app/tests" />
<option name="IS_MODULE_SDK" value="true" />
<option name="IS_MODULE_SDK" value="false" />
Copy link
Member Author

@longshuicy longshuicy Jul 30, 2024

Choose a reason for hiding this comment

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

you might've accidentally committed the pycharm setting

<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
Expand All @@ -14,4 +15,4 @@
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
</component>
</component>
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [v2.0.0-beta.3] - 2024-07-29

### Added

- License management
- Release dataset with versions
- Enable and disable user account through Keycloak
- Jupyterhub integration
- Interface for creating and editing matching criteria for triggering extractors
- Interface for editing metadata definitions
- My dataset tab listing all the datasets created by the user
- Drag and drop upload multiple files
- Footer with links to documentation, source code, and contact information
- Documentation through MKDocs

### Changed

- Allow public datasets and files to be searchable
- List all the extractors with the ability to enable/disable the extractors
- Filter listeners based on their support for file or dataset
- Helm chart updated to support custom existing secret

### Fixed

- Clowder registration link on the top bar
- Case-insensitive search
- Download count immediately increments after download

## [v2.0.0-beta.2] - 2024-02-16

### Added
Expand Down
2 changes: 1 addition & 1 deletion backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Settings(BaseSettings):
API_V2_STR: str = "/api/v2"
admin_email: str = "[email protected]"
frontend_url: str = "http://localhost:3000"
version: str = "2.0.0-beta.2"
version: str = "2.0.0-beta.3"

# Unique secret for hashing API keys. Generate with `openssl rand -hex 32`
local_auth_secret = "clowder_secret_key"
Expand Down
10 changes: 9 additions & 1 deletion backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
MetadataDefinitionDB,
MetadataFreezeDB,
)
from app.models.project import ProjectDB
from app.models.thumbnails import ThumbnailDB, ThumbnailDBViewList, ThumbnailFreezeDB
from app.models.tokens import TokenDB
from app.models.users import ListenerAPIKeyDB, UserAPIKeyDB, UserDB
Expand Down Expand Up @@ -55,6 +56,7 @@
metadata,
metadata_datasets,
metadata_files,
projects,
public_datasets,
public_elasticsearch,
public_files,
Expand Down Expand Up @@ -86,7 +88,7 @@
description="A cloud native data management framework to support any research domain. Clowder was "
"developed to help researchers and scientists in data intensive domains manage raw data, complex "
"metadata, and automatic data pipelines. ",
version="2.0.0-beta.2",
version="2.0.0-beta.3",
contact={"name": "Clowder", "url": "https://clowderframework.org/"},
license_info={
"name": "Apache 2.0",
Expand Down Expand Up @@ -250,6 +252,11 @@
prefix="/public_thumbnails",
tags=["public_thumbnails"],
)
api_router.include_router(
projects.router,
prefix="/projects",
tags=["projects"],
)
api_router.include_router(
licenses.router,
prefix="/licenses",
Expand Down Expand Up @@ -315,6 +322,7 @@ async def startup_beanie():
ThumbnailFreezeDB,
ThumbnailDBViewList,
LicenseDB,
ProjectDB,
],
recreate_views=True,
)
Expand Down
42 changes: 42 additions & 0 deletions backend/app/models/project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from datetime import datetime
from enum import Enum, auto
from typing import List, Optional

import pymongo
from app.models.authorization import AuthorizationDB, RoleType
from app.models.groups import GroupOut
from app.models.users import UserOut
from beanie import Document, PydanticObjectId, View
from pydantic import BaseModel, Field


class Member(BaseModel):
user: UserOut
editor: bool = False


class ProjectBase(BaseModel):
id: PydanticObjectId = Field(default_factory=PydanticObjectId, alias="_id")
name: str
description: Optional[str] = None
created: datetime = Field(default_factory=datetime.utcnow)
modified: datetime = Field(default_factory=datetime.utcnow)
dataset_ids: Optional[List[PydanticObjectId]] = []
folder_ids: Optional[List[PydanticObjectId]] = []
file_ids: Optional[List[PydanticObjectId]] = []
creator: UserOut
users: List[Member] = []


class ProjectDB(Document, ProjectBase):
class Settings:
name = "projects"


class ProjectIn(ProjectBase):
pass


class ProjectOut(ProjectDB):
class Config:
fields = {"id": "id"}
Loading
Loading