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

Voila mode #340

Merged
merged 33 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
900ef45
Voila mode wip
mmarchetti Feb 6, 2023
46f27df
Voila icons
mmarchetti Feb 6, 2023
7ea5946
temporarily use branch of rsconnect-python
mmarchetti Feb 6, 2023
e305bd7
update Pipfile.lock for python 3.8
mmarchetti Feb 7, 2023
5dc7e94
more patient waiting for Jupyter to start
mmarchetti Feb 7, 2023
89146b1
pass through Jupyter logs
mmarchetti Feb 7, 2023
8839a3b
Revert "pass through Jupyter logs"
mmarchetti Feb 7, 2023
e315831
dump Jupyter log
mmarchetti Feb 7, 2023
7678933
re-lock Pipfile.lock
mmarchetti Feb 10, 2023
9384937
remove echo suppression
mmarchetti Feb 10, 2023
2910d00
label jupyter log
mmarchetti Feb 10, 2023
9e226c3
upload logs as artifacts
mmarchetti Feb 10, 2023
f3e73e7
artifact on failure
mmarchetti Feb 10, 2023
40e2d7e
fix temporary rsconnect-python URL
mmarchetti Feb 13, 2023
723786a
fix git url again
mmarchetti Feb 13, 2023
80ee016
fix URL
mmarchetti Feb 13, 2023
97694a1
remove pipenv
mmarchetti Feb 13, 2023
118f61a
Merge branch 'master' into mm-voila
mmarchetti Feb 14, 2023
f4d0e4f
fix notebook path in make run
mmarchetti Feb 14, 2023
1bac0bf
uninstall old plugin before installing
mmarchetti Feb 14, 2023
f2618f8
Merge branch 'mm-voila' of github.com:rstudio/rsconnect-jupyter into …
mmarchetti Feb 14, 2023
ffe77c8
fix notebook dir
mmarchetti Feb 14, 2023
7d00034
add Voila to the docs
mmarchetti Feb 15, 2023
204d9bd
deploy in single file mode
mmarchetti Feb 27, 2023
dedc8f9
disable code cell hiding in Voila mode
mmarchetti Feb 27, 2023
5ded8d4
lint
mmarchetti Feb 28, 2023
3d7402b
rsconnect-python from master branch
mmarchetti Mar 7, 2023
3948150
Merge branch 'master' into mm-voila
mmarchetti Mar 7, 2023
3dc1047
update to rsconnect-python 1.15.0b1
mmarchetti Mar 7, 2023
bc4e9a0
Merge branch 'mm-voila' of github.com:rstudio/rsconnect-jupyter into …
mmarchetti Mar 7, 2023
6706207
add asyncmock
mmarchetti Mar 7, 2023
f2f84da
Merge branch 'master' into mm-voila
mmarchetti Mar 7, 2023
73e517d
import from asyncmock
mmarchetti Mar 7, 2023
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
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

29 changes: 21 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,21 @@ jobs:
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make prereqs
- run: make version
- run: make install
- run: make lint
- run: make test
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v2
with:
python-version: 3.8
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make prereqs
- run: make version
- run: make yarn
- run: make lint
selenium:
runs-on: ubuntu-latest
steps:
Expand All @@ -52,6 +64,11 @@ jobs:
- run: make -C selenium test-env-up
- run: make -C selenium jupyter-up
- run: make -C selenium test
- uses: actions/upload-artifact@v3
if: failure()
with:
name: selenium-logs
path: '**/*.log'
distributions:
needs: test
runs-on: ubuntu-latest
Expand All @@ -63,18 +80,14 @@ jobs:
python-version: 3.8.x
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make prereqs
- run: pipenv clean
- run: pipenv install --skip-lock --dev
- run: pipenv run pip install -U 'SecretStorage>=3'
- run: git reset --hard HEAD
- run: make dist
id: create_dist
- uses: actions/upload-artifact@v2
with:
name: distributions
path: dist/
- run: pipenv run pip install -vvv ${{ steps.create_dist.outputs.whl }}
- run: pipenv run python -c 'import rsconnect_jupyter;print(rsconnect_jupyter.__version__)'
- run: pip install -vvv ${{ steps.create_dist.outputs.whl }}
- run: python -c 'import rsconnect_jupyter;print(rsconnect_jupyter.__version__)'
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
id: create_release
uses: actions/create-release@v1
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,11 @@ jobs:
with:
fetch-depth: 0

- name: Install pipenv
run: |
python -m pip install --upgrade pipenv

- name: Install Pipfile dependencies (as required by Snyk)
run: pipenv install

- name: Run Snyk
uses: snyk/actions/python@master
with:
command: monitor
args: --file=Pipfile --project-name=python --org=${{ env.SNYK_ORG }}
args: --file=requirements-dev.txt --project-name=python --org=${{ env.SNYK_ORG }}
ui:
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ RUN useradd --password password \
chown ${NB_UID}:${NB_GID} /rsconnect_jupyter

USER ${NB_UID}:${NB_GID}
WORKDIR /rsconnect_jupyter
ENV WORKON_HOME=/home/builder \
PIPENV_DONT_LOAD_ENV=1 \
PIPENV_SHELL=/bin/bash \
PATH=/home/builder/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
PYTHONPATH=/rsconnect_jupyter
COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock
RUN python -m pip install -I -U pip pipenv && \
pipenv install --dev --python=/usr/local/bin/python && \
rm -vf Pipfile*
COPY requirements.txt .
COPY requirements-dev.txt .
RUN /usr/local/bin/python -m pip install -I -U pip && \
/usr/local/bin/python -m pip install -r requirements-dev.txt
WORKDIR /rsconnect_jupyter
47 changes: 17 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IMAGE := rstudio/rsconnect-jupyter-py
NOTEBOOKS_DIR := /notebooks
PORT := $(shell printenv PORT || echo 9999)
S3_PREFIX := s3://rstudio-connect-downloads/connect/rsconnect-jupyter
VERSION := $(shell pipenv run python setup.py --version 2>/dev/null || echo 'NOTSET')
VERSION := $(shell python setup.py --version 2>/dev/null || echo 'NOTSET')

BDIST_WHEEL := dist/rsconnect_jupyter-$(VERSION)-py2.py3-none-any.whl
JUPYTER_LOG_LEVEL ?= INFO
Expand All @@ -17,16 +17,14 @@ export SOURCE_DATE_EPOCH
PYTHONPATH ?= $(CURDIR)
export PYTHONPATH


.PHONY: prereqs
prereqs:
pip install -U pip
pip install -U pipenv

pip install -r requirements-dev.txt

.PHONY: install-latest-rsconnect-python
install-latest-rsconnect-python:
pipenv run pip install -U https://cdn.rstudio.com/connect/rsconnect-python/latest/rsconnect_python-latest-py2.py3-none-any.whl
pip install -U https://cdn.rstudio.com/connect/rsconnect-python/latest/rsconnect_python-latest-py2.py3-none-any.whl

.PHONY: clean
clean:
Expand All @@ -45,12 +43,8 @@ image%:
--build-arg PY_VERSION=$* \
.

.PHONY: all-tests
all-tests: test3.7 test3.8 test3.9 test3.10 test3.11

.PHONY: test
test: version-frontend
pipenv run pytest -vv --cov=rsconnect_jupyter tests/
pytest -vv --cov=rsconnect_jupyter tests/

.PHONY: test-selenium
test-selenium:
Expand All @@ -64,36 +58,29 @@ test-selenium:
# exported as a point of reference instead.
.PHONY: dist
dist: version-frontend
pipenv run python setup.py bdist_wheel
pipenv run twine check $(BDIST_WHEEL)
rm -vf dist/*.whl
python setup.py bdist_wheel
twine check $(BDIST_WHEEL)
rm -vf dist/*.egg
@echo "::set-output name=whl::$(BDIST_WHEEL)"
@echo "::set-output name=whl_basename::$(notdir $(BDIST_WHEEL))"

.PHONY: run
run: install
mkdir -p $(NOTEBOOKS_DIR)
pipenv run jupyter notebook \
jupyter notebook \
-y \
--log-level=$(JUPYTER_LOG_LEVEL) \
--notebook-dir=$(NOTEBOOKS_DIR) \
--notebook-dir=./notebooks3 \
--ip='0.0.0.0' \
--port=9999 \
--no-browser \
--NotebookApp.token=''

.PHONY: run-local
run-local: NOTEBOOKS_DIR := $(CURDIR)/notebooks3.8
run-local: run

.PHONY: install
install: yarn
pipenv install --dev
$(MAKE) install-latest-rsconnect-python
$(MAKE) version-frontend
pipenv run jupyter nbextension install --symlink --user --py rsconnect_jupyter
pipenv run jupyter nbextension enable --py rsconnect_jupyter
pipenv run jupyter serverextension enable --py rsconnect_jupyter
install: version-frontend
jupyter nbextension uninstall rsconnect_jupyter || true
jupyter nbextension install --symlink --user --py rsconnect_jupyter
jupyter nbextension enable --py rsconnect_jupyter
jupyter serverextension enable --py rsconnect_jupyter

build/mock-connect/bin/flask:
bash -c '\
Expand Down Expand Up @@ -121,12 +108,12 @@ lint-js:

.PHONY: lint-py
lint-py:
pipenv run black --check --diff ./rsconnect_jupyter
pipenv run flake8 ./rsconnect_jupyter
black --check --diff ./rsconnect_jupyter
flake8 ./rsconnect_jupyter

.PHONY: fmt
fmt:
pipenv run black ./rsconnect_jupyter
black ./rsconnect_jupyter

## Specify that Docker runs with the calling user's uid/gid to avoid file
## permission issues on Linux dev hosts.
Expand Down
35 changes: 0 additions & 35 deletions Pipfile

This file was deleted.

Loading