Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sspickle committed Jun 18, 2023
0 parents commit ddd3343
Show file tree
Hide file tree
Showing 318 changed files with 17,521 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Dockerfile
README.md
*.pyc
*.pyo
*.pyd
__pycache__
.pytest_cache
*~
/venv

6 changes: 6 additions & 0 deletions .flaskenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FLASK_APP=main.py
FLASK_ENV=development
FLASK_DEBUG=1
TEMPLATES_AUTO_RELOAD=1
FLASK_RUN_HOST=localhost
FLASK_RUN_PORT=8070
3 changes: 3 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!svc_acct_cred.json
/venv

12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

node_modules
bower_components
*.pyc
.DS_Store
/venv
__pycache__/
*~
/.vscode/
/ide/.vscode
/ide/flask_secret.py

41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

# Use the official lightweight Python image.
# https://hub.docker.com/_/python
FROM python:3.10-slim

# Allow statements and log messages to immediately appear in the Knative logs
ENV PYTHONUNBUFFERED True

# Copy local code to the container image.
ENV APP_HOME /app
WORKDIR $APP_HOME

RUN groupadd -r pyuser && useradd -r -g pyuser pyuser

RUN mkdir /home/pyuser

RUN chown -R pyuser:pyuser /home/pyuser

RUN chown -R pyuser:pyuser $APP_HOME

COPY requirements.txt $APP_HOME

RUN python3 -m venv $APP_HOME/venv

RUN $APP_HOME/venv/bin/pip install -U pip

RUN $APP_HOME/venv/bin/pip install --no-cache-dir -r requirements.txt

COPY . /app

RUN chown -R pyuser:pyuser $APP_HOME

USER pyuser

# Run the web service on container startup. Here we use the gunicorn
# webserver, with one worker process and 8 threads.
# For environments with multiple CPU cores, increase the number of workers
# to be equal to the cores available.
# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.

CMD exec $APP_HOME/venv/bin/gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 main:app
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Cloud service to run RapydScript WebVPython programs

This is a runner for RapydScript WebVPython programs. The runner is meant to be embedded as an iframe within a host application. The host communicates with the runner through the iframe's "postMessage" method.

The runner can send results, errors, and screen grabs back to the host window postMessge.

You must configure the "trusted host" environment variable on the deployed system to match the root URL of the host using this runner.

30 changes: 30 additions & 0 deletions css/help.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
body { margin-bottom: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px }


a:link, a:visited, a:hover {
color: #0000ff;
font-weight: bold;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}
/* overrides decoration from previous rule for hovered links */

td, textarea, input, select { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px}
.sectionHead { font-size: 16px; line-height: 30px; font-weight: bold; color: #000000;}
.tableDetail { background-color: #CCCCCC;}
.tableHeading { color:#FFFFFF; text-decoration: bold ; background-color: #424973}
.Courier {
font-family: "Courier New", Courier, monospace;
}
.program {
font-family: "Courier New", Courier, monospace;
color: #03F;
}
.program {
color: #00C;
font-family: "Courier New", Courier, monospace;
font-weight: bold;
}
Loading

0 comments on commit ddd3343

Please sign in to comment.