-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e34fda7
commit ee94756
Showing
5 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
# Save release data to database | ||
`save_release.py` is used to save release data to the database. It takes a release data JSON file as input in the format described in `test_release_data.json`. | ||
To save the release data to the database, run the following command: | ||
|
||
``` | ||
python save_release.py test_release_data.json | ||
``` | ||
|
||
## Update Model Status | ||
To update the model status, run the following command: | ||
|
||
``` | ||
python update_model_status.py <spack_hash_of_model> <status> | ||
``` | ||
The `status` can be `active`, `retracted`, `eol` or `deleted`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import sys | ||
from models import * | ||
|
||
def update_model_status(model, status): | ||
try: | ||
session = create_session() | ||
model = session.query(ModelBuild).filter(ModelBuild.spack_hash == model).update({ | ||
"status": status | ||
}) | ||
session.commit() | ||
print("model status updated successfully") | ||
except Exception as e: | ||
print(e) | ||
session.rollback() | ||
raise | ||
|
||
finally: | ||
session.close() | ||
|
||
|
||
if __name__ == "__main__": | ||
update_model_status(sys.argv[1], sys.argv[2]) |