-
Notifications
You must be signed in to change notification settings - Fork 53
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
UIP-47: Misc tidying #3558
UIP-47: Misc tidying #3558
Conversation
…src/ folder for ease of updating, and updating the docs accordingly. also added some typing to some python files edited dockerfile to transfer over individual folders instead of copying the whole repo and creating an image with a load of unnecessary junk in it.
- package-ecosystem: pip | ||
directory: "/docker_image_dependencies" | ||
schedule: | ||
interval: monthly | ||
time: '11:00' | ||
groups: | ||
docker-image-python-deps: | ||
patterns: | ||
"*" | ||
open-pull-requests-limit: 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the requirements files are now in the /src directory, so 🤞 dependabot will be a bit more dependable in reporting updates
WORKDIR /kb/dev_container/narrative | ||
|
||
RUN mkdir -p /kb/deployment/ui-common/ && \ | ||
mkdir -p /tmp/narrative && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just moved up from the end of this section
# Compile Javascript down into an itty-bitty ball unless SKIP_MINIFY is non-empty | ||
echo Skip="$SKIP_MINIFY" && \ | ||
[ -n "$SKIP_MINIFY" ] || npm run minify && \ | ||
# install the narrative and jupyter console | ||
# Generate a version file that we can scrape later | ||
./src/scripts/kb-update-config -f src/config.json.templ -o /kb/deployment/ui-common/narrative_version && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved a little later in the block for ease of development
@@ -56,7 +56,7 @@ This is built on the Jupyter Notebook v6.5.6 and IPython 8.25.0 (more notes will | |||
- scikit-learn: 1.2.1 -> 1.5.0 | |||
- statsmodels: 0.14.2 (new) | |||
- terminado: 0.17.1 -> 0.18.0 | |||
- tornado: 6.2 -> 6.4 | |||
- tornado: 6.2 -> 6.4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course there's another update just when I thought I had all the python stuff done...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😬
@@ -1,30 +1,32 @@ | |||
## Building Narrative Images with Dockerhub | |||
(Updated 6/1/2018) | |||
|
|||
We currently make use of Travis and Dockerhub (https://hub.docker.com) to manage Narrative production builds. There are three images here that stack on each other. | |||
We currently make use of GitHub Actions and the GitHub Packages (aka the GitHubContainer Repository, https://ghcr.io) to manage Narrative production builds. The narrative comprises two images (to facilitate reasonable narrative build times) and a third tiny image for the narrative version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
started updating this documentation; will do some more on it when I get this ui-assets thing sorted out
|
||
### How to build images | ||
Travis-CI is used to run regression testing on the branches declared in the branches stanza of the top level travis.yml file. Currently the travis file builds on these branches: | ||
|
||
GitHub Actions is used to run regression testing on the branches declared in the branches stanza of the top level travis.yml file. Currently the travis file builds on these branches: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enthusiasm/energy for documentation ran out here.
NAR_BASE="kbase/narrbase" | ||
NAR_BASE_VER="7.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not anymore it doesn't!
@@ -58,21 +56,6 @@ mkdir -p $WEBROOT_DIR | |||
./src/scripts/kb-update-config -f src/config.json.templ -o $WEBROOT_DIR/narrative_version -e $env -d $dev_mode || exit 1 | |||
cp kbase-extension/static/kbase/config/data_source_config.json $WEBROOT_DIR/data_source_config.json | |||
|
|||
# Make sure the base image is there. If not, build it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all refers to the narrbase image, which is no longer with us.
@@ -8,12 +8,10 @@ | |||
PYTHON=python | |||
|
|||
SCRIPT_TGT="kbase-narrative" | |||
SCRIPT_TGT2="headless-narrative" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this script exists but it points at a python file that no longer does ==> delete the code so that people aren't tempted to try it
@@ -105,8 +106,8 @@ class KBaseWSManager(KBaseWSManagerMixin, ContentsManager): | |||
# a safety net | |||
wsid_regex = re.compile(r"[\W]+", re.UNICODE) | |||
|
|||
def __init__(self, *args, **kwargs): | |||
"""Verify that we can connect to the configured WS instance""" | |||
def __init__(self: "KBaseWSManager", *args, **kwargs) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all typing changes here
def dir_exists(self, path): | ||
"""If it's blank, just return True - | ||
def dir_exists(self: "KBaseWSManager", path: str) -> bool: | ||
"""Returns a boolean indicating whether a directory exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting fancy -- typing AND some basic documentation!
nar_id = "ws.{}.obj.{}".format(nar["wsid"], nar["objid"]) | ||
model = base_model("{} - {} - {}".format(nar["saved_by"], nar_id, nar["name"]), nar_id) | ||
def _wsobj_to_model(self: "KBaseWSManager", nar, content: bool = True) -> dict[str, Any]: | ||
nar_id = f"ws.{nar['wsid']}.obj.{nar['objid']}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use f"..."
instead of string.format
@@ -1,7 +1,9 @@ | |||
"""Utils for implementing the KBase Narrative manager.""" | |||
|
|||
from typing import Any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all typing
@@ -6,9 +6,11 @@ | |||
import json | |||
import re | |||
from collections import Counter | |||
from typing import Any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typing additions
@@ -9,4 +9,4 @@ pyyaml==6.0.1 | |||
requests==2.32.3 | |||
scikit-learn==1.5.0 | |||
statsmodels==0.14.2 | |||
tornado==6.4 | |||
tornado==6.4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated package
Quality Gate failedFailed conditions |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3558 +/- ##
===========================================
- Coverage 29.70% 25.74% -3.97%
===========================================
Files 496 461 -35
Lines 50444 46694 -3750
===========================================
- Hits 14984 12021 -2963
+ Misses 35460 34673 -787 see 36 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
ADD ./deployment/ /kb/deployment/ | ||
WORKDIR /kb/dev_container/narrative | ||
ADD ./build.js /kb/dev_container/narrative/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying over the directories and files that are actually used, instead of everything under the sun. Attempted to order them by approximate likelihood of being changed, although everything after nbextensions is a lot more likely to be edited than the stuff before it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Eventually (not this PR, and maybe not right away) it might be nice to make a production-only image and leave out tests, test data, test-only dependencies, and so on.
But this is a good step on that path!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
ADD ./deployment/ /kb/deployment/ | ||
WORKDIR /kb/dev_container/narrative | ||
ADD ./build.js /kb/dev_container/narrative/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Eventually (not this PR, and maybe not right away) it might be nice to make a production-only image and leave out tests, test data, test-only dependencies, and so on.
But this is a good step on that path!
@@ -56,7 +56,7 @@ This is built on the Jupyter Notebook v6.5.6 and IPython 8.25.0 (more notes will | |||
- scikit-learn: 1.2.1 -> 1.5.0 | |||
- statsmodels: 0.14.2 (new) | |||
- terminado: 0.17.1 -> 0.18.0 | |||
- tornado: 6.2 -> 6.4 | |||
- tornado: 6.2 -> 6.4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😬
NAR_BASE="kbase/narrbase" | ||
NAR_BASE_VER="7.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not anymore it doesn't!
Description of PR purpose/changes
Some miscellaneous fixes and so on that I made over the last day or so. Includes:
src/
so it's easier to update py dependencies;Jira Ticket / Issue
Related Jira ticket: https://kbase-jira.atlassian.net/browse/UIP-47
DATAUP-69 Adds a PR template
)Testing Instructions
Dev Checklist:
format
andcheck
on changed Python code manually or with a git precommit hookUpdating Version and Release Notes (if applicable)