Skip to content

Commit

Permalink
Merge branch 'main' into chore/documentation-admin
Browse files Browse the repository at this point in the history
  • Loading branch information
a3957273 authored Feb 16, 2024
2 parents 18d16fd + 7e4a08f commit a08ed63
Show file tree
Hide file tree
Showing 431 changed files with 19,328 additions and 25,092 deletions.
137 changes: 0 additions & 137 deletions .github/workflows/build.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -395,143 +395,6 @@ jobs:
name: logs
path: logs

end_to_end_beta:
needs: [build_backend, build_frontend]
runs-on: ubuntu-latest

steps:
# Clone repository
- uses: actions/checkout@v3

- name: Free up disk space
run: |
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
echo "Check free disk space before cleanup."
df -h
echo "Removing non-essential tools and libraries."
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /opt/ghc
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/share/boost
# Delete libraries for Android (12G), PowerShell (1.3G), Swift (1.7G)
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/share/swift
echo "Check free disk space after cleanup."
df -h
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"

# Setup BuildX
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Get Bailo Docker images
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: bailo_backend
path: /tmp
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: bailo_frontend
path: /tmp

- name: Load image
run: |
docker load --input /tmp/bailo_frontend.tar
docker load --input /tmp/bailo_backend.tar
docker image ls -a
rm -rf /tmp/bailo_frontend.tar /tmp/bailo_backend.tar
# Create logs directory
- run: mkdir logs

# Create certs
- run: sudo chown -R runner:docker backend/certs
- run: npm run certs

# Configure application
- name: Configure Bailo
run: |
cat <<EOT >> backend/config/local.cjs
module.exports = {
minio: {
accessKey: 'minioadmin',
secretKey: 'minioadmin',
},
smtp: {
auth: {
user: 'mailuser',
pass: 'mailpass',
},
tls: {
rejectUnauthorized: false,
},
},
logging: {
file: {
path: '/home/runner/work/Bailo/Bailo/logs/out.log',
},
},
}
EOT
- run: docker-compose -f docker-compose-prod.yml up -d

# Install dependencies
- run: npm ci

# wait for app to start
- run: |
chmod +x ./backend/src/scripts/waitForIt.sh
./backend/src/scripts/waitForIt.sh localhost:8080 -t 10
# wait for mongo to start
- run: |
chmod +x ./backend/src/scripts/waitForIt.sh
./backend/src/scripts/waitForIt.sh localhost:27017 -t 10
- uses: cypress-io/github-action@v5
with:
working-directory: ./frontend
install: false
spec: cypress/e2e/beta/**/*

- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots-e2e
path: frontend/cypress/screenshots

# - uses: actions/upload-artifact@v3
# if: always()
# with:
# name: cypress-videos
# path: cypress/videos

- name: Dump docker-compose logs
if: always()
run: docker-compose logs > logs/stack.log

- name: Docker Compose Logs
if: always()
run: cat logs/stack.log

- uses: actions/upload-artifact@v3
if: always()
with:
name: logs
path: logs

integration_python:
needs: [build_backend, build_frontend]
runs-on: ubuntu-latest
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,9 @@ permissions:
id-token: write

jobs:
build-sphinx:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.11'

- name: Install pandoc
run: sudo apt install pandoc

- name: Build Sphinx docs
run: |
python -m pip install --upgrade pip
pwd
cd lib/python-beta/docs
python -m pip install -r requirements.txt
make dirhtml
# Build job
build:
runs-on: ubuntu-latest
needs: build-sphinx
defaults:
run:
working-directory: lib/landing
Expand Down Expand Up @@ -89,7 +65,6 @@ jobs:
run: npm i
- name: Run generator
run: npm run generate

- name: Build and export
run: npm run export
env:
Expand Down
41 changes: 20 additions & 21 deletions backend/config/default.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ module.exports = {
schema: require('../src/scripts/example_schemas/minimal_deployment_schema.json'),
},
],
v2: {
modelCards: [
{
name: 'Minimal Schema v10',
id: 'minimal-general-v10',
description:
"This is the latest version of the default model card for users from West. It complies with all requirements laid out in the [AI Policy](https://example.com) as well as best practices recommended by 'Science and Research'.\n\nIf you're unsure which model card to pick, you'll likely want this one!",
jsonSchema: require('../src/scripts/example_schemas/minimal_model_schema.json'),
},
],
accessRequests: [
{
name: 'Minimal Access Request Schema v10',
id: 'minimal-access-request-general-v10',
description:
'This access request should be used for models that are being deployed by the same organisation that created it and MAY be being used for operational use cases.\n\n ✔ Development Work \n ✔ Operational Deployments \n ✖ Second Party Sharing',
jsonSchema: require('../src/scripts/example_schemas/minimal_access_request_schema.json'),
},
],
},
},

session: {
Expand Down Expand Up @@ -191,32 +211,11 @@ module.exports = {
host: 'localhost:8080',
},

// A configurable checkbox on the last page when uploading a model
uploadWarning: {
showWarning: true,
checkboxText: 'By checking here you confirm that the information is correct',
},

// A configurable checkbox on the last page when requesting a deployment
deploymentWarning: {
showWarning: true,
checkboxText: 'By checking here you confirm that the information is correct',
},

// Used by some admin pages (e.g. the logs) to directly open the correct page in your IDE
// Not needed in production
development: {
logUrl: 'vscode://file/home/ec2-user/git/Bailo/',
},

// The available seldon versions that can be used to build images
seldonVersions: [
{
name: 'seldonio - 1.10.0',
image: 'seldonio/seldon-core-s2i-python37:1.10.0',
},
],
maxModelSizeGB: 50,
},

connectors: {
Expand Down
2 changes: 1 addition & 1 deletion backend/python-docs/_build/dirhtml/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: db1993bf4fe87f6a0d251d9236d6e7ea
config: dbafcd98063260b5743f60ed267116f6
tags: d77d1c0d9ca2f4c8421862c7c5a0d620
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=19f00094" />


<link rel="shortcut icon" href="../../../../_static/favicon.png"/>
<!--[if lt IE 9]>
<script src="../../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
Expand All @@ -33,6 +34,7 @@

<a href="../../../../" class="icon icon-home">
Bailo Python Client Docs
<img src="../../../../_static/vertical-white.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search/" method="get">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=19f00094" />


<link rel="shortcut icon" href="../../../../_static/favicon.png"/>
<!--[if lt IE 9]>
<script src="../../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
Expand All @@ -33,6 +34,7 @@

<a href="../../../../" class="icon icon-home">
Bailo Python Client Docs
<img src="../../../../_static/vertical-white.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search/" method="get">
Expand Down Expand Up @@ -422,24 +424,48 @@ <h1>Source code for bailo.core.client</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="p">,</span>
<span class="n">model_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">file_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">buffer</span><span class="p">:</span> <span class="n">BytesIO</span><span class="p">,</span>
<span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Download a specific file.</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Download a specific file by it&#39;s id.</span>

<span class="sd"> :param model_id: Unique model ID</span>
<span class="sd"> :param file_id: Unique file ID</span>
<span class="sd"> :param buffer: BytesIO object for bailo to write to</span>
<span class="sd"> :return: The unique file ID</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">agent</span><span class="p">,</span> <span class="n">TokenAgent</span><span class="p">):</span>
<span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">agent</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">agent</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">url</span><span class="si">}</span><span class="s2">/v2/token/model/</span><span class="si">{</span><span class="n">model_id</span><span class="si">}</span><span class="s2">/file/</span><span class="si">{</span><span class="n">file_id</span><span class="si">}</span><span class="s2">/download&quot;</span><span class="p">,</span> <span class="n">stream</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10_000</span>
<span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">agent</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">url</span><span class="si">}</span><span class="s2">/v2/model/</span><span class="si">{</span><span class="n">model_id</span><span class="si">}</span><span class="s2">/file/</span><span class="si">{</span><span class="n">file_id</span><span class="si">}</span><span class="s2">/download&quot;</span><span class="p">,</span> <span class="n">stream</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10_000</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">agent</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">url</span><span class="si">}</span><span class="s2">/v2/model/</span><span class="si">{</span><span class="n">model_id</span><span class="si">}</span><span class="s2">/file/</span><span class="si">{</span><span class="n">file_id</span><span class="si">}</span><span class="s2">/download&quot;</span><span class="p">,</span> <span class="n">stream</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10_000</span>
<span class="p">)</span></div>


<div class="viewcode-block" id="Client.get_download_by_filename">
<a class="viewcode-back" href="../../../../bailo.core/#bailo.core.client.Client.get_download_by_filename">[docs]</a>
<span class="k">def</span> <span class="nf">get_download_by_filename</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">model_id</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">semver</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">filename</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Download a specific file.</span>

<span class="n">shutil</span><span class="o">.</span><span class="n">copyfileobj</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">raw</span><span class="p">,</span> <span class="n">buffer</span><span class="p">)</span>
<span class="k">return</span> <span class="n">file_id</span></div>
<span class="sd"> :param model_id: Unique model ID</span>
<span class="sd"> :param semver: Semver of the release</span>
<span class="sd"> :param filename: The filename trying to download from</span>
<span class="sd"> :return: The filename</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">agent</span><span class="p">,</span> <span class="n">TokenAgent</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">agent</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">url</span><span class="si">}</span><span class="s2">/v2/token/model/</span><span class="si">{</span><span class="n">model_id</span><span class="si">}</span><span class="s2">/release/</span><span class="si">{</span><span class="n">semver</span><span class="si">}</span><span class="s2">/file/</span><span class="si">{</span><span class="n">filename</span><span class="si">}</span><span class="s2">/download&quot;</span><span class="p">,</span>
<span class="n">stream</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">timeout</span><span class="o">=</span><span class="mi">10_000</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">agent</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">url</span><span class="si">}</span><span class="s2">/v2/model/</span><span class="si">{</span><span class="n">model_id</span><span class="si">}</span><span class="s2">/release/</span><span class="si">{</span><span class="n">semver</span><span class="si">}</span><span class="s2">/file/</span><span class="si">{</span><span class="n">filename</span><span class="si">}</span><span class="s2">/download&quot;</span><span class="p">,</span> <span class="n">stream</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="mi">10_000</span>
<span class="p">)</span></div>


<div class="viewcode-block" id="Client.simple_upload">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=19f00094" />


<link rel="shortcut icon" href="../../../../_static/favicon.png"/>
<!--[if lt IE 9]>
<script src="../../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
Expand All @@ -33,6 +34,7 @@

<a href="../../../../" class="icon icon-home">
Bailo Python Client Docs
<img src="../../../../_static/vertical-white.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search/" method="get">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=19f00094" />


<link rel="shortcut icon" href="../../../../_static/favicon.png"/>
<!--[if lt IE 9]>
<script src="../../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
Expand All @@ -33,6 +34,7 @@

<a href="../../../../" class="icon icon-home">
Bailo Python Client Docs
<img src="../../../../_static/vertical-white.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search/" method="get">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=19f00094" />


<link rel="shortcut icon" href="../../../../_static/favicon.png"/>
<!--[if lt IE 9]>
<script src="../../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
Expand All @@ -33,6 +34,7 @@

<a href="../../../../" class="icon icon-home">
Bailo Python Client Docs
<img src="../../../../_static/vertical-white.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search/" method="get">
Expand Down
Loading

0 comments on commit a08ed63

Please sign in to comment.