Skip to content

Commit

Permalink
slight modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBRoswell committed Aug 8, 2024
1 parent f6cf9b5 commit 175eb05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions vreapis/containerizer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import jsonschema
from slugify import slugify
from github import Github, UnknownObjectException
from django.conf import settings

from catalog.serializers import CellSerializer
from containerizer.RContainerizer import RContainerizer
Expand Down Expand Up @@ -94,8 +95,7 @@ def post(self, request: Request):
# common.logger.debug('ExtractorHandler. payload: ' + json.dumps(payload, indent=4))
if 'rmarkdown' in payload:
# Directly setting `NotebookNode.metadata['jupytext'] = {'split_at_heading': True, }` has no use. I don't know why. So we don't use lib jupytext here.
venv_activator = '/opt/venv/bin/activate'
command_jupytext = f'source {venv_activator}; jupytext --from Rmd --to ipynb --opt split_at_heading=true -o -'
command_jupytext = f'source {settings.VENV_ACTIVATOR}; jupytext --from Rmd --to ipynb --opt split_at_heading=true -o -'
process_jupytext = subprocess.Popen(command_jupytext, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, executable='/bin/bash')
stdout, stderr = process_jupytext.communicate(input=payload['rmarkdown'].encode())
process_jupytext.stdin.close()
Expand Down
4 changes: 3 additions & 1 deletion vreapis/vreapis/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
STATIC_URL = f'{BASE_PATH}/static/'
STATIC_ROOT = BASE_DIR / "staticfiles"

# CUSTOM VARS
# CUSTOM VARS # todo. delete default values

API_ENDPOINT: str = os.getenv('API_ENDPOINT', "https://naavre-dev.minikube.test/vre-api-test")

Expand All @@ -199,3 +199,5 @@
KEYCLOAK_CLIENT_ID: str = os.getenv('KEYCLOAK_CLIENT_ID', 'myclient')

NAAVRE_API_TOKEN: str = os.getenv('NAAVRE_API_TOKEN')

VENV_ACTIVATOR: str = os.getenv('VENV_ACTIVATOR', '/opt/venv/bin/activate')

0 comments on commit 175eb05

Please sign in to comment.