Skip to content

Commit

Permalink
Pods Service - Listing, Creation, Deletion (#355)
Browse files Browse the repository at this point in the history
* pods - part 1

* pods - part 2

* pods - part3 - delete pod working

* pods - part 4 - create pod working

* Force json details to expand to length of json

* pods - part 5 - newest package.json

* Pods, fixes for tests.

* Adding latest package-lock.json

* Fix linting

* Ran `npm run prettier` and then `npm run lint`

* Removing vestigial references to systems. Fix in PodToolbar. Removing unused PodListing.
  • Loading branch information
NotChristianGarcia authored Mar 14, 2024
1 parent e1591a0 commit 116a240
Show file tree
Hide file tree
Showing 42 changed files with 7,163 additions and 25,306 deletions.
31,025 changes: 5,722 additions & 25,303 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@fortawesome/react-fontawesome": "^0.1.8",
"@material-ui/core": "^4.12.3",
"@reduxjs/toolkit": "^1.5.1",
"@tapis/tapis-typescript": "^0.0.24",
"@tapis/tapis-typescript": "^0.0.26",
"@uiw/react-codemirror": "^4.19.7",
"@uiw/react-textarea-code-editor": "^2.0.6",
"axios": "^0.21.4",
Expand Down
50 changes: 50 additions & 0 deletions src/fixtures/pods.fixtures.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
export const tapisPod = {
pod_id: 'testpod2',
pod_template: 'template/postgres',
description: 'Test pod fixture for testing',
command: undefined,
environment_variables: {},
data_requests: [],
roles_required: [],
status_requested: 'ON',
volume_mounts: {
test4: {
type: 'tapisvolume',
mount_path: '/var/lib/postgresql/data',
sub_path: '',
},
},
time_to_stop_default: -1,
time_to_stop_instance: undefined,
networking: {
default: {
protocol: 'postgres',
port: 5432,
url: 'test4.pods.tacc.develop.tapis.io',
},
},
resources: {
cpu_request: 250,
cpu_limit: 2000,
mem_request: 256,
mem_limit: 3072,
gpus: 0,
},
time_to_stop_ts: null,
status: 'AVAILABLE',
status_container: {
phase: 'Running',
start_time: '2024-02-13T20:58:32.000000',
message: 'Pod is running.',
},
data_attached: [],
roles_inherited: [],
creation_ts: '2024-02-13T20:58:31.358557',
update_ts: '2024-02-13T20:58:31.358649',
start_instance_ts: '2024-02-13T20:59:08.175504',
action_logs: [
"24/02/13 20:58: Pod object created by 'cgarcia'",
'24/02/13 20:58: spawner set status to CREATING',
'24/02/13 20:59: health set status to AVAILABLE',
],
};
14 changes: 14 additions & 0 deletions src/tapis-api/pods/deletePod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Pods } from '@tapis/tapis-typescript';
import { apiGenerator, errorDecoder } from 'tapis-api/utils';

const deletePod = (podId: string, basePath: string, jwt: string) => {
const api: Pods.PodsApi = apiGenerator<Pods.PodsApi>(
Pods,
Pods.PodsApi,
basePath,
jwt
);
return errorDecoder<Pods.DeletePodResponse>(() => api.deletePod({ podId }));
};

export default deletePod;
14 changes: 14 additions & 0 deletions src/tapis-api/pods/details.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Pods } from '@tapis/tapis-typescript';
import { apiGenerator, errorDecoder } from 'tapis-api/utils';

const details = (params: Pods.GetPodRequest, basePath: string, jwt: string) => {
const api: Pods.PodsApi = apiGenerator<Pods.PodsApi>(
Pods,
Pods.PodsApi,
basePath,
jwt
);
return errorDecoder<Pods.PodResponse>(() => api.getPod(params));
};

export default details;
4 changes: 4 additions & 0 deletions src/tapis-api/pods/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as list } from './list';
export { default as details } from './details';
export { default as makeNewPod } from './makeNewPod';
export { default as deletePod } from './deletePod';
14 changes: 14 additions & 0 deletions src/tapis-api/pods/list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Pods } from '@tapis/tapis-typescript';
import { apiGenerator, errorDecoder } from 'tapis-api/utils';

const list = (params: {}, basePath: string, jwt: string) => {
const api: Pods.PodsApi = apiGenerator<Pods.PodsApi>(
Pods,
Pods.PodsApi,
basePath,
jwt
);
return errorDecoder<Pods.PodsResponse>(() => api.getPods());
};

export default list;
18 changes: 18 additions & 0 deletions src/tapis-api/pods/makeNewPod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Pods } from '@tapis/tapis-typescript';
import { apiGenerator, errorDecoder } from 'tapis-api/utils';

const makeNewPod = (
reqCreatePod: Pods.CreatePodRequest,
basePath: string,
jwt: string
) => {
const api: Pods.PodsApi = apiGenerator<Pods.PodsApi>(
Pods,
Pods.PodsApi,
basePath,
jwt
);
return errorDecoder<Pods.PodResponse>(() => api.createPod(reqCreatePod));
};

export default makeNewPod;
16 changes: 16 additions & 0 deletions src/tapis-app/Pods/PodDetail/_Layout/Layout.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/tapis-app/Pods/PodDetail/_Layout/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/tapis-app/Pods/PodDetail/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions src/tapis-app/Pods/_Layout/Layout.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/tapis-app/Pods/_Layout/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions src/tapis-app/Pods/_Router/Router.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/tapis-app/Pods/_Router/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 116a240

Please sign in to comment.