Skip to content

Commit

Permalink
Merge pull request #157 from I-GUIDE/develop
Browse files Browse the repository at this point in the history
Deploy (1.1.1) to production
  • Loading branch information
pkdash committed May 24, 2024
2 parents d984028 + e3641b1 commit 6a21e11
Show file tree
Hide file tree
Showing 21 changed files with 264 additions and 121 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
VITE_APP_GOOGLE_MAPS_API_KEY: ""
VITE_APP_SUPPORT_EMAIL: help@example.com
VITE_APP_CLIENT_ID: APP-4ZA8C8BYAH3QHNE9
SEARCH_RELEVANCE_SCORE_THRESHOLD: 1.4


jobs:
Expand All @@ -36,7 +37,7 @@ jobs:
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
run: |
variables=("OIDC_ISSUER" "DB_USERNAME" "DB_PASSWORD" "DB_HOST" "DATABASE_NAME" "DB_PROTOCOL" "TESTING" "VITE_APP_LOGIN_URL" "HYDROSHARE_META_READ_URL" "HYDROSHARE_FILE_READ_URL")
variables=("OIDC_ISSUER" "DB_USERNAME" "DB_PASSWORD" "DB_HOST" "DATABASE_NAME" "DB_PROTOCOL" "TESTING" "VITE_APP_LOGIN_URL" "HYDROSHARE_META_READ_URL" "HYDROSHARE_FILE_READ_URL" "SEARCH_RELEVANCE_SCORE_THRESHOLD")
# Empty the .env file
> .env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
directory: "/frontend" # Location of package manifests
schedule:
interval: "weekly"
3 changes: 2 additions & 1 deletion .github/workflows/deploy-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
VITE_APP_LOGIN_URL: https://orcid.org/oauth/authorize
VITE_APP_SUPPORT_EMAIL: help@example.com
VITE_APP_CLIENT_ID: APP-4ZA8C8BYAH3QHNE9
SEARCH_RELEVANCE_SCORE_THRESHOLD: 1.4


jobs:
Expand All @@ -44,7 +45,7 @@ jobs:
DB_USERNAME: ${{ secrets.DB_USERNAME_BETA }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD_BETA }}
run: |
variables=("OIDC_ISSUER" "DB_USERNAME" "DB_PASSWORD" "DB_HOST" "DATABASE_NAME" "DB_PROTOCOL" "TESTING" "VITE_APP_LOGIN_URL" "HYDROSHARE_META_READ_URL" "HYDROSHARE_FILE_READ_URL")
variables=("OIDC_ISSUER" "DB_USERNAME" "DB_PASSWORD" "DB_HOST" "DATABASE_NAME" "DB_PROTOCOL" "TESTING" "VITE_APP_LOGIN_URL" "HYDROSHARE_META_READ_URL" "HYDROSHARE_FILE_READ_URL" "SEARCH_RELEVANCE_SCORE_THRESHOLD")
# Empty the .env file
> .env
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
VITE_APP_LOGIN_URL: https://orcid.org/oauth/authorize
VITE_APP_SUPPORT_EMAIL: help@example.com
VITE_APP_CLIENT_ID: APP-4ZA8C8BYAH3QHNE9
SEARCH_RELEVANCE_SCORE_THRESHOLD: 1.4


jobs:
Expand All @@ -45,7 +46,7 @@ jobs:
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
run: |
variables=("OIDC_ISSUER" "DB_USERNAME" "DB_PASSWORD" "DB_HOST" "DATABASE_NAME" "DB_PROTOCOL" "TESTING" "VITE_APP_LOGIN_URL" "HYDROSHARE_META_READ_URL" "HYDROSHARE_FILE_READ_URL")
variables=("OIDC_ISSUER" "DB_USERNAME" "DB_PASSWORD" "DB_HOST" "DATABASE_NAME" "DB_PROTOCOL" "TESTING" "VITE_APP_LOGIN_URL" "HYDROSHARE_META_READ_URL" "HYDROSHARE_FILE_READ_URL" "SEARCH_RELEVANCE_SCORE_THRESHOLD")
# Empty the .env file
> .env
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.detectIndentation": true
}
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# I-GUIDE catalog API
I-GUIDE Catalog API
# I-GUIDE Catalog

The I-GUIDE Catalog is part of of the [I-GUIDE Cyberinfrastructure Platform](https://i-guide.io/platform/). The Platform supports collaborative research along with computation and data-intensive geospatial problem solving. Within the context of the I-GUIDE Platform, the goal of the Catalog is to allow users to find, explore, and share data, models, code, software, hosted services, computational resources, and learning materials. A major goal of the catalog is to make these resources "actionable" - e.g., once a user finds a resource, they should be able to interact with the content of the resource and/or launch it into an appropriate analysis or computational environment for execution and exploration.

## Deployment

The I-GUIDE Catalog is currently deployed at [https://iguide.cuahsi.io/](https://iguide.cuahsi.io/).

## Issue Tracker

Please report any bugs or ideas for enhancements to the I-GUIDE Catalog issue tracker:

[https://github.com/I-GUIDE/catalog/issues](https://github.com/I-GUIDE/catalog/issues)

## License

The I-GUIDE Catalog is released under the BSD 3-Clause License. This means that you can do what you want with the code [provided that you inlude the BSD copyright and license notice in it](https://www.tldrlegal.com/license/bsd-3-clause-license-revised).

©2024 I-GUIDE Developers.

## Sponsors and Credits

[![NSF-2118329](https://img.shields.io/badge/NSF-2118329-blue.svg)](https://nsf.gov/awardsearch/showAward?AWD_ID=2118329)

This material is based upon work supported by the National Science Foundation (NSF) under award [2118329](https://www.nsf.gov/awardsearch/showAward?AWD_ID=2118329). Any opinions, findings, conclusions, or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the NSF.

## Developer Information

### Getting Started
```console
Expand Down Expand Up @@ -43,7 +68,7 @@ TESTING=True
```

2. Login and submit a record to create all the collections
3. Run `triggers/management/change_streams_pre_and_post.py`
3. Run `api/models/management/change_streams_pre_and_post.py`
4. Create the catalog and typeahead indexes from `atlas/` (TODO detailed instructions)

### Triggers
Expand Down
1 change: 1 addition & 0 deletions api/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Settings(BaseSettings):
oidc_issuer: str
hydroshare_meta_read_url: HttpUrl
hydroshare_file_read_url: HttpUrl
search_relevance_score_threshold: float = 1.4

def __init__(self, **data: Any) -> None:
super().__init__(**data)
Expand Down
5 changes: 3 additions & 2 deletions api/models/management/change_streams_pre_and_post.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import asyncio
from api.config import get_settings
from api.models.catalog import DatasetMetadataDOC

from beanie import init_beanie
from motor.motor_asyncio import AsyncIOMotorClient

from api.config import get_settings
from api.models.catalog import DatasetMetadataDOC


async def main():
db = AsyncIOMotorClient(get_settings().db_connection_string)
Expand Down
9 changes: 4 additions & 5 deletions api/models/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,16 @@ class TemporalCoverage(SchemaBaseModel):
title="Start date",
description="A date/time object containing the instant corresponding to the commencement of the time "
"interval (ISO8601 formatted date - YYYY-MM-DDTHH:MM).",
# TODO: these are failing due to a problem with transpiled dependencies inside cznet-vue-core
# formatMaximum={"$data": "1/endDate"},
# errorMessage= { "formatMaximum": "must be lesser than or equal to End date" }
formatMaximum={"$data": "1/endDate"},
errorMessage= { "formatMaximum": "must be lesser than or equal to End date" }
)
endDate: Optional[datetime] = Field(
title="End date",
description="A date/time object containing the instant corresponding to the termination of the time "
"interval (ISO8601 formatted date - YYYY-MM-DDTHH:MM). If the ending date is left off, "
"that means the temporal coverage is ongoing.",
# formatMinimum={"$data": "1/startDate"},
# errorMessage= { "formatMinimum": "must be greater than or equal to Start date" }
formatMinimum={"$data": "1/startDate"},
errorMessage= { "formatMinimum": "must be greater than or equal to Start date" }
)


Expand Down
24 changes: 24 additions & 0 deletions api/models/schemas/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,24 @@
"startDate": {
"title": "Start date",
"description": "A date/time object containing the instant corresponding to the commencement of the time interval (ISO8601 formatted date - YYYY-MM-DDTHH:MM).",
"formatMaximum": {
"$data": "1/endDate"
},
"errorMessage": {
"formatMaximum": "must be lesser than or equal to End date"
},
"type": "string",
"format": "date-time"
},
"endDate": {
"title": "End date",
"description": "A date/time object containing the instant corresponding to the termination of the time interval (ISO8601 formatted date - YYYY-MM-DDTHH:MM). If the ending date is left off, that means the temporal coverage is ongoing.",
"formatMinimum": {
"$data": "1/startDate"
},
"errorMessage": {
"formatMinimum": "must be greater than or equal to Start date"
},
"type": "string",
"format": "date-time"
}
Expand Down Expand Up @@ -2021,12 +2033,24 @@
"startDate": {
"title": "Start date",
"description": "A date/time object containing the instant corresponding to the commencement of the time interval (ISO8601 formatted date - YYYY-MM-DDTHH:MM).",
"formatMaximum": {
"$data": "1/endDate"
},
"errorMessage": {
"formatMaximum": "must be lesser than or equal to End date"
},
"type": "string",
"format": "date-time"
},
"endDate": {
"title": "End date",
"description": "A date/time object containing the instant corresponding to the termination of the time interval (ISO8601 formatted date - YYYY-MM-DDTHH:MM). If the ending date is left off, that means the temporal coverage is ongoing.",
"formatMinimum": {
"$data": "1/startDate"
},
"errorMessage": {
"formatMinimum": "must be greater than or equal to Start date"
},
"type": "string",
"format": "date-time"
}
Expand Down
10 changes: 8 additions & 2 deletions api/routes/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from fastapi import APIRouter, Request, Depends
from pydantic import BaseModel, validator

from api.config import get_settings

router = APIRouter()


Expand Down Expand Up @@ -91,7 +93,7 @@ def _filters(self):

@property
def _should(self):
search_paths = ['name', 'description', 'keywords', 'keywords.name']
search_paths = ['name', 'description', 'keywords', 'keywords.name', 'creator.name']
should = [
{'autocomplete': {'query': self.term, 'path': key, 'fuzzy': {'maxEdits': 1}}} for key in search_paths
]
Expand Down Expand Up @@ -125,7 +127,7 @@ def _must(self):

@property
def stages(self):
highlightPaths = ['name', 'description', 'keywords', 'keywords.name']
highlightPaths = ['name', 'description', 'keywords', 'keywords.name', 'creator.name']
stages = []
compound = {'filter': self._filters, 'must': self._must}
if self.term:
Expand Down Expand Up @@ -153,6 +155,10 @@ def stages(self):
stages.append(
{'$set': {'score': {'$meta': 'searchScore'}, 'highlights': {'$meta': 'searchHighlights'}}},
)
if self.term:
# get only results which meet minimum relevance score threshold
score_threshold = get_settings().search_relevance_score_threshold
stages.append({'$match': {'score': {'$gt': score_threshold}}})
return stages


Expand Down
51 changes: 44 additions & 7 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "i-guide-catalog",
"version": "1.1.0",
"version": "1.1.1",
"private": true,
"scripts": {
"serve": "vite --open",
Expand All @@ -21,6 +21,7 @@
"@vuex-orm/core": "^0.36.4",
"deepmerge": "^4.3.1",
"dompurify": "^3.1.2",
"github-markdown-css": "^5.5.1",
"google-maps": "^4.3.3",
"lodash.isequal": "^4.5.0",
"markdown-it": "^14.1.0",
Expand All @@ -34,6 +35,7 @@
"vue-facing-decorator": "^3.0.4",
"vue-i18n": "^9.13.1",
"vue-router": "^4.3.2",
"vue-timeago3": "^2.3.2",
"vuetify": "^3.6.3",
"vuex": "^4.1.0",
"vuex-persistedstate": "^4.1.0"
Expand Down Expand Up @@ -74,4 +76,4 @@
"lint-staged": {
"*": "eslint --fix"
}
}
}
5 changes: 0 additions & 5 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,6 @@ class App extends Vue {
label: "Register",
icon: "mdi-link-plus",
},
// {
// attrs: { href: "https://dsp.criticalzone.org/" },
// label: "Contribute Data",
// icon: "mdi-book-plus",
// },
];
User.fetchSchemas();
Expand Down
Loading

0 comments on commit 6a21e11

Please sign in to comment.