Skip to content

Commit

Permalink
Added types for notebookimage and status (opendatahub-io#147)
Browse files Browse the repository at this point in the history
Updated with REST api notebook image endpoints and new notebook image types.
Updated REST API  (opendatahub-io#155)

* Updated with REST API design changes.

Fixed formatting error.

* Update backend/src/types.ts

Co-authored-by: Tom Coufal <[email protected]>

Co-authored-by: Tom Coufal <[email protected]>
Updated type.ts in front end with Succeeded
[byon] Implement backend (opendatahub-io#156)

* feat(byon): List all notebooks

Signed-off-by: Tomas Coufal <[email protected]>

* feat(byon): Get single notebook

Signed-off-by: Tomas Coufal <[email protected]>

* fix(byon): Update api spec to include software and id

Signed-off-by: Tomas Coufal <[email protected]>

* feat(byon): Schedule new notebook import

Signed-off-by: Tomas Coufal <[email protected]>

* feat(byon): Delete notebook

Signed-off-by: Tomas Coufal <[email protected]>

* feat(byon): Update notebook

Signed-off-by: Tomas Coufal <[email protected]>
Rebased BYON from master (opendatahub-io#162)

* Updated way that to detect an admin. (opendatahub-io#137)

Fixed linting error.

* Update backend port setting and makefile dev commands. (opendatahub-io#133)

* Update README.md (opendatahub-io#96)

Updated Readme to specify that a build is required prior to running the development server.

* Fix for input not allowing blank spaces.:

Fix to allow a user to enter an empty string.

Fixed with review comment.

* Add culler timeout settings feature (opendatahub-io#134)

* Added types for notebookimage and status (opendatahub-io#147)

Updated with REST api notebook image endpoints and new notebook image types.

* Updated REST API  (opendatahub-io#155)

* Updated with REST API design changes.

Fixed formatting error.

* Update backend/src/types.ts

Co-authored-by: Tom Coufal <[email protected]>

Co-authored-by: Tom Coufal <[email protected]>

* Updated type.ts in front end with Succeeded

* [byon] Implement backend (opendatahub-io#156)

* feat(byon): List all notebooks

Signed-off-by: Tomas Coufal <[email protected]>

* feat(byon): Get single notebook

Signed-off-by: Tomas Coufal <[email protected]>

* fix(byon): Update api spec to include software and id

Signed-off-by: Tomas Coufal <[email protected]>

* feat(byon): Schedule new notebook import

Signed-off-by: Tomas Coufal <[email protected]>

* feat(byon): Delete notebook

Signed-off-by: Tomas Coufal <[email protected]>

* feat(byon): Update notebook

Signed-off-by: Tomas Coufal <[email protected]>

Co-authored-by: Christopher Chase <[email protected]>
Co-authored-by: Chad Roberts <[email protected]>
Co-authored-by: Juntao Wang <[email protected]>
Co-authored-by: Tom Coufal <[email protected]>
fix(byon): Use notebook-image label for visibility toggle (opendatahub-io#169)

Signed-off-by: Tomas Coufal <[email protected]>
feat(byon): Feat add creator annotation (opendatahub-io#170)

Signed-off-by: Tomas Coufal <[email protected]>
feat(byon): Allow to patch name and description on notebook (opendatahub-io#172)

Signed-off-by: Tomas Coufal <[email protected]>
feat(byon): Allow python dependency visibility field changes (opendatahub-io#173)

Signed-off-by: Tomas Coufal <[email protected]>
Added code for importing byon image. (opendatahub-io#171)

Updated front end code with import and start of table.
Updated with byon changes

Updated code with byon ui changes.
Integrated import, delete, and get functionality for notebooks.

Added start of edit panel.

Updated build error fixes.

Updates to edit dialog and linting cleanup.

Added sort to table.

Added filtering.

Added failure warning to allow user to click

Add check disable enabling failed notebook images

Fixed with review comments.

Fixed time bug.

Removed admin
  • Loading branch information
dlabaj committed Apr 8, 2022
1 parent f34a2bb commit 55c89c3
Show file tree
Hide file tree
Showing 34 changed files with 1,820 additions and 175 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ SOURCE_REPOSITORY_REF=master
DOC_LINK ='https://opendatahub.io/docs.html'
COMMUNITY_LINK ='https://opendatahub.io/community.html'
ENABLED_APPS_CM = 'odh-enabled-applications-config'
ADMIN_GROUP = 'odh-admins'
16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@ reinstall: build push undeploy deploy

##################################

# DEV - run apps locally for development

.PHONY: dev-frontend
dev-frontend:
./install/dev-frontend.sh

.PHONY: dev-backend
dev-backend:
./install/dev-backend.sh

.PHONY: dev
dev:
./install/dev.sh

##################################

# BUILD - build image locally using s2i

.PHONY: build
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ Before developing for ODH, the basic requirements:
$ cd odh-dashboard && npm install
```
### Build project
```
$ npm run build
```
### Serve development content
This is the default context for running a local UI
This is the default context for running a local UI. Make sure you build the project using the instructions above prior to running the command below.
```
$ npm run start
Expand Down
10 changes: 8 additions & 2 deletions backend/src/routes/api/cluster-settings/clusterSettingsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export const updateClusterSettings = async (
const query = request.query as { [key: string]: string };
try {
const jupyterhubCM = await coreV1Api.readNamespacedConfigMap(name, namespace);
if (query.pvcSize) {
if (query.pvcSize && query.cullerTimeout) {
await coreV1Api.patchNamespacedConfigMap(
name,
namespace,
{
data: { singleuser_pvc_size: `${query.pvcSize}Gi` },
data: { singleuser_pvc_size: `${query.pvcSize}Gi`, culler_timeout: query.cullerTimeout },
},
undefined,
undefined,
Expand All @@ -33,6 +33,11 @@ export const updateClusterSettings = async (
if (jupyterhubCM.body.data.singleuser_pvc_size.replace('Gi', '') !== query.pvcSize) {
await scaleDeploymentConfig(fastify, 'jupyterhub', 0);
}
if (jupyterhubCM.body.data['culler_timeout'] !== query.cullerTimeout) {
// scale down to 0 and scale it up to 1
await scaleDeploymentConfig(fastify, 'jupyterhub-idle-culler', 0);
await scaleDeploymentConfig(fastify, 'jupyterhub-idle-culler', 1);
}
}
return { success: true, error: null };
} catch (e) {
Expand All @@ -52,6 +57,7 @@ export const getClusterSettings = async (
const clusterSettingsRes = await coreV1Api.readNamespacedConfigMap(name, namespace);
return {
pvcSize: Number(clusterSettingsRes.body.data.singleuser_pvc_size.replace('Gi', '')),
cullerTimeout: Number(clusterSettingsRes.body.data.culler_timeout),
};
} catch (e) {
if (e.response?.statusCode !== 404) {
Expand Down
1 change: 0 additions & 1 deletion backend/src/routes/api/cluster-settings/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
import { DEV_MODE } from '../../../utils/constants';
import { getClusterSettings, updateClusterSettings } from './clusterSettingsUtils';

export default async (fastify: FastifyInstance): Promise<void> => {
Expand Down
60 changes: 60 additions & 0 deletions backend/src/routes/api/notebook/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
import {
addNotebook,
deleteNotebook,
getNotebook,
getNotebooks,
updateNotebook,
} from './notebooksUtils';

export default async (fastify: FastifyInstance): Promise<void> => {
fastify.get('/', async (request: FastifyRequest, reply: FastifyReply) => {
return getNotebooks(fastify)
.then((res) => {
return res;
})
.catch((res) => {
reply.send(res);
});
});

fastify.get('/:notebook', async (request: FastifyRequest, reply: FastifyReply) => {
return getNotebook(fastify, request)
.then((res) => {
return res;
})
.catch((res) => {
reply.send(res);
});
});

fastify.delete('/:notebook', async (request: FastifyRequest, reply: FastifyReply) => {
return deleteNotebook(fastify, request)
.then((res) => {
return res;
})
.catch((res) => {
reply.send(res);
});
});

fastify.put('/:notebook', async (request: FastifyRequest, reply: FastifyReply) => {
return updateNotebook(fastify, request)
.then((res) => {
return res;
})
.catch((res) => {
reply.send(res);
});
});

fastify.post('/', async (request: FastifyRequest, reply: FastifyReply) => {
return addNotebook(fastify, request)
.then((res) => {
return res;
})
.catch((res) => {
reply.send(res);
});
});
};
Loading

0 comments on commit 55c89c3

Please sign in to comment.