Skip to content

Commit 0aa641b

Browse files
committed
Squashed commit of the following:
commit ef6ddf7 Author: wzrdx <128477299+wzrdx@users.noreply.github.com> Date: Thu Oct 23 16:03:29 2025 +0300 fix: Refactor service tag so it's serializable commit 38b2723 Author: wzrdx <128477299+wzrdx@users.noreply.github.com> Date: Thu Oct 23 15:56:15 2025 +0300 fix: GpuType schema bug commit f437d25 Author: wzrdx <128477299+wzrdx@users.noreply.github.com> Date: Thu Oct 23 15:37:14 2025 +0300 fix: Allow editing the allowReplicationInTheWild field of a job commit 6a18a0f Author: wzrdx <128477299+wzrdx@users.noreply.github.com> Date: Thu Oct 23 15:26:05 2025 +0300 fix: Edit job failing for native jobs with chainstore response = false
1 parent fee93f2 commit 0aa641b

File tree

12 files changed

+53
-63
lines changed

12 files changed

+53
-63
lines changed

src/components/create-job/steps/deployment/ServiceDeployment.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import InputWithLabel from '@shared/InputWithLabel';
66
import ServiceInputsSection from '@shared/jobs/ServiceInputsSection';
77
import TargetNodesCard from '@shared/jobs/target-nodes/TargetNodesCard';
88
import { JobSpecifications, JobType } from '@typedefs/deeploys';
9+
import clsx from 'clsx';
910
import { useEffect } from 'react';
1011
import { useFormContext } from 'react-hook-form';
1112

@@ -27,7 +28,23 @@ function ServiceDeployment({ isEditingJob }: { isEditingJob?: boolean }) {
2728

2829
return (
2930
<div className="col gap-6">
30-
<SlateCard title="Service Identity" label={containerOrWorkerType?.tag}>
31+
<SlateCard
32+
title="Service Identity"
33+
label={
34+
containerOrWorkerType?.tag ? (
35+
<div
36+
className={clsx(
37+
'center-all h-[30px] rounded-md bg-blue-100 px-2',
38+
containerOrWorkerType.tag.bgClass,
39+
)}
40+
>
41+
<div className={clsx('row gap-1.5', containerOrWorkerType.tag.textClass)}>
42+
<div className="compact">{containerOrWorkerType.tag.text}</div>
43+
</div>
44+
</div>
45+
) : null
46+
}
47+
>
3148
<div className="flex gap-4">
3249
<InputWithLabel name="deployment.jobAlias" label="Alias" placeholder="Service" />
3350
</div>

src/components/create-job/steps/specifications/GenericSpecifications.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ export default function GenericSpecifications({
2727

2828
<SelectGPU jobType={JobType.Generic} isDisabled={isEditingJob} />
2929

30-
<ContainerResourcesInfo
31-
jobType={JobType.Generic}
32-
name="specifications.containerType"
33-
options={genericContainerTypes}
34-
/>
30+
<ContainerResourcesInfo name="specifications.containerType" options={genericContainerTypes} />
3531
</SlateCard>
3632

3733
<SpecsNodesSection

src/components/create-job/steps/specifications/NativeSpecifications.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function NativeSpecifications({
2727

2828
<SelectGPU jobType={JobType.Native} isDisabled={isEditingJob} />
2929

30-
<ContainerResourcesInfo jobType={JobType.Native} name="specifications.workerType" options={nativeWorkerTypes} />
30+
<ContainerResourcesInfo name="specifications.workerType" options={nativeWorkerTypes} />
3131
</SlateCard>
3232

3333
<SpecsNodesSection

src/components/create-job/steps/specifications/ServiceSpecifications.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import SelectContainerOrWorkerType from '@shared/jobs/SelectContainerOrWorkerTyp
66
import JobTags from '@shared/jobs/target-nodes/JobTags';
77
import NumberInputWithLabel from '@shared/NumberInputWithLabel';
88
import SelectWithLabel from '@shared/SelectWithLabel';
9-
import { JobType } from '@typedefs/deeploys';
109

1110
export default function ServiceSpecifications({ isEditingJob }: { isEditingJob?: boolean }) {
1211
return (
@@ -19,11 +18,7 @@ export default function ServiceSpecifications({ isEditingJob }: { isEditingJob?:
1918
isDisabled={isEditingJob}
2019
/>
2120

22-
<ContainerResourcesInfo
23-
jobType={JobType.Service}
24-
name="specifications.containerType"
25-
options={serviceContainerTypes}
26-
/>
21+
<ContainerResourcesInfo name="specifications.containerType" options={serviceContainerTypes} />
2722
</SlateCard>
2823

2924
<SlateCard>

src/components/edit-job/ReviewAndConfirm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ type JobFormValues = z.infer<typeof jobSchema>;
1616
type StepKey = 'specifications' | 'costAndDuration' | 'deployment';
1717

1818
const hasDirtyFields = (dirtyValue: unknown): boolean => {
19-
if (!dirtyValue) {
20-
return false;
19+
if (typeof dirtyValue === 'boolean') {
20+
return dirtyValue;
2121
}
2222

23-
if (dirtyValue === true) {
24-
return true;
23+
if (!dirtyValue) {
24+
return false;
2525
}
2626

2727
if (Array.isArray(dirtyValue)) {

src/components/job/config/JobConfigurations.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import StyledSelect from '@shared/StyledSelect';
77
import { JobConfig } from '@typedefs/deeployApi';
88
import { JobType, RunningJobWithResources } from '@typedefs/deeploys';
99
import _, { isEmpty } from 'lodash';
10-
import { useEffect, useState } from 'react';
10+
import { useState } from 'react';
1111
import JobDynamicEnvSection from '../JobDynamicEnvSection';
1212
import JobFileVolumesSection from '../JobFileVolumesSection';
1313
import JobKeyValueSection from '../JobKeyValueSection';
@@ -41,10 +41,6 @@ export default function JobConfigurations({ job }: { job: RunningJobWithResource
4141

4242
const config = pluginConfig.value;
4343

44-
useEffect(() => {
45-
console.log('Config', pluginConfig);
46-
}, [pluginConfig]);
47-
4844
return (
4945
<BorderedCard isLight={false} disableWrapper>
5046
<div className="col gap-3 p-4">

src/data/containerResources.tsx

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export type Service = ContainerOrWorkerType & {
1919
port?: number;
2020
image?: string;
2121
dbSystem?: string;
22-
tag?: React.ReactNode;
22+
tag?: {
23+
text: string;
24+
bgClass: string;
25+
textClass: string;
26+
};
2327
inputs?: { key: string; label: string }[];
2428
};
2529

@@ -44,30 +48,6 @@ export type RunningJobResources = {
4448
jobType: JobType;
4549
};
4650

47-
const getPostgresTag = () => (
48-
<div className="center-all h-[30px] rounded-md bg-blue-100 px-2">
49-
<div className="row gap-1.5 text-blue-600">
50-
<div className="compact">PostgreSQL</div>
51-
</div>
52-
</div>
53-
);
54-
55-
const getMySQLTag = () => (
56-
<div className="center-all h-[30px] rounded-md bg-orange-100 px-2">
57-
<div className="row gap-0.5 text-orange-600">
58-
<div className="compact">MySQL</div>
59-
</div>
60-
</div>
61-
);
62-
63-
const getMongoDBTag = () => (
64-
<div className="center-all h-[30px] rounded-md bg-green-100 px-2">
65-
<div className="row gap-0.5 text-green-600">
66-
<div className="compact">MongoDB</div>
67-
</div>
68-
</div>
69-
);
70-
7151
export const genericContainerTypes: ContainerOrWorkerType[] = [
7252
{
7353
id: 1,
@@ -273,7 +253,7 @@ export const serviceContainerTypes: Service[] = [
273253
port: 5432,
274254
image: 'postgres:17',
275255
dbSystem: 'PostgreSQL',
276-
tag: getPostgresTag(),
256+
tag: { text: 'PostgreSQL', bgClass: 'bg-blue-100', textClass: 'text-blue-600' },
277257
inputs: [{ key: 'POSTGRES_PASSWORD', label: 'PostgreSQL Password' }],
278258
},
279259
{
@@ -292,7 +272,7 @@ export const serviceContainerTypes: Service[] = [
292272
port: 5432,
293273
image: 'postgres:17',
294274
dbSystem: 'PostgreSQL',
295-
tag: getPostgresTag(),
275+
tag: { text: 'PostgreSQL', bgClass: 'bg-blue-100', textClass: 'text-blue-600' },
296276
inputs: [{ key: 'POSTGRES_PASSWORD', label: 'PostgreSQL Password' }],
297277
},
298278
{
@@ -311,7 +291,7 @@ export const serviceContainerTypes: Service[] = [
311291
port: 3306,
312292
image: 'mysql',
313293
dbSystem: 'MySQL',
314-
tag: getMySQLTag(),
294+
tag: { text: 'MySQL', bgClass: 'bg-orange-100', textClass: 'text-orange-600' },
315295
inputs: [{ key: 'MYSQL_ROOT_PASSWORD', label: 'MySQL Root Password' }],
316296
},
317297
{
@@ -330,7 +310,7 @@ export const serviceContainerTypes: Service[] = [
330310
port: 3306,
331311
image: 'mysql',
332312
dbSystem: 'MySQL',
333-
tag: getMySQLTag(),
313+
tag: { text: 'MySQL', bgClass: 'bg-orange-100', textClass: 'text-orange-600' },
334314
inputs: [{ key: 'MYSQL_ROOT_PASSWORD', label: 'MySQL Root Password' }],
335315
},
336316
{
@@ -349,7 +329,7 @@ export const serviceContainerTypes: Service[] = [
349329
port: 27017,
350330
image: 'mongodb',
351331
dbSystem: 'MongoDB',
352-
tag: getMongoDBTag(),
332+
tag: { text: 'MongoDB', bgClass: 'bg-green-100', textClass: 'text-green-600' },
353333
inputs: [
354334
{ key: 'MONGO_INITDB_ROOT_USERNAME', label: 'MongoDB Root Username' },
355335
{ key: 'MONGO_INITDB_ROOT_PASSWORD', label: 'MongoDB Root Password' },
@@ -371,7 +351,7 @@ export const serviceContainerTypes: Service[] = [
371351
port: 27017,
372352
image: 'mongodb',
373353
dbSystem: 'MongoDB',
374-
tag: getMongoDBTag(),
354+
tag: { text: 'MongoDB', bgClass: 'bg-green-100', textClass: 'text-green-600' },
375355
inputs: [
376356
{ key: 'MONGO_INITDB_ROOT_USERNAME', label: 'MongoDB Root Username' },
377357
{ key: 'MONGO_INITDB_ROOT_PASSWORD', label: 'MongoDB Root Password' },

src/lib/deeploy-utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ export const getContainerOrWorkerType = (jobType: JobType, specifications: JobSp
106106
};
107107

108108
export const getGpuType = (specifications: GenericJobSpecifications | NativeJobSpecifications): GpuType | undefined => {
109-
return specifications.gpuType ? gpuTypes.find((type) => type.name === specifications.gpuType) : undefined;
109+
return specifications.gpuType && specifications.gpuType !== ''
110+
? gpuTypes.find((type) => type.name === specifications.gpuType)
111+
: undefined;
110112
};
111113

112114
export const downloadDataAsJson = (data: any, filename: string) => {

src/pages/deeploys/job/EditJob.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,10 @@ export default function EditJob() {
180180
}
181181

182182
if (
183-
updatePipelineResponse.status === 'success' &&
184-
(increasingTargetNodes ? scaleUpWorkersResponse.status === 'success' : true)
183+
(updatePipelineResponse.status === 'success' || updatePipelineResponse.status === 'command_delivered') &&
184+
(increasingTargetNodes
185+
? scaleUpWorkersResponse.status === 'success' || scaleUpWorkersResponse.status === 'command_delivered'
186+
: true)
185187
) {
186188
deeployFlowModalRef.current?.progress('done');
187189
setFetchAppsRequired(true);
@@ -225,8 +227,12 @@ export default function EditJob() {
225227
text = 'Request timed out';
226228
} else if (response.error) {
227229
text = response.error;
228-
} else if (response.status && response.status !== 'success') {
229-
text = `Request failed with status ${response.status}`;
230+
} else if (
231+
response.status &&
232+
response.status !== 'success' &&
233+
response.status !== 'command_delivered'
234+
) {
235+
text = `Request failed with status: ${response.status}`;
230236
}
231237

232238
if (!text) {

src/shared/jobs/ContainerResourcesInfo.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import { ContainerOrWorkerType, GpuType, gpuTypes } from '@data/containerResources';
22
import Label from '@shared/Label';
33
import { SmallTag } from '@shared/SmallTag';
4-
import { JobType } from '@typedefs/deeploys';
54
import { useEffect, useState } from 'react';
65
import { useFormContext } from 'react-hook-form';
76

87
interface Props {
9-
jobType: JobType;
108
name: string;
119
options: ContainerOrWorkerType[];
1210
}
1311

14-
export default function ContainerResourcesInfo({ jobType, name, options }: Props) {
12+
export default function ContainerResourcesInfo({ name, options }: Props) {
1513
const { watch } = useFormContext();
1614

1715
const containerOrWorkerTypeName: string = watch(name);

0 commit comments

Comments
 (0)