Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-130226 / 24.10 / Improves App installation, update, deletion #10394

Merged
merged 36 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dd8cb28
NAS-130055: Removes roles for kubernetes
RehanY147 Jul 25, 2024
9892135
NAS-130055: Removes roles limitations on app-details-header
RehanY147 Jul 25, 2024
fcda02b
NAS-130055: Removed roles from app-settings
RehanY147 Jul 25, 2024
175417f
NAS-130055: Removes kubernetes service start
RehanY147 Jul 25, 2024
836abbc
NAS-130055: Updates KubernetesSettingsComponent to ContainerSettingsC…
RehanY147 Jul 25, 2024
84597bc
NAS-130055: Remove unused translation strings
RehanY147 Jul 25, 2024
2317e78
NAS-130055: Adds `DockerService` and related interfaces
RehanY147 Jul 25, 2024
e940aaf
NAS-130055: Converts `KubernetesSettingsComponent` to `DockerStatusCo…
RehanY147 Jul 25, 2024
18ca9bd
NAS-130055: Updates docker-status-component folder name
RehanY147 Jul 25, 2024
fdf2e38
NAS-130055: Removes use of `KubernetesStore` and `kubernetes` api calls
RehanY147 Jul 26, 2024
f549d7b
NAS-130055: Removed non-required settings page
RehanY147 Jul 30, 2024
75c8456
NAS-130055: PR fixes
RehanY147 Jul 30, 2024
a36f6c6
NAS-130055: Fixed tests
RehanY147 Jul 30, 2024
0670a06
Merge branch 'master' into NAS-130055
RehanY147 Jul 30, 2024
da1d0e0
NAS-130055: Fixed method call
RehanY147 Jul 30, 2024
a0c5565
NAS-130055: Fix sync catalog call
RehanY147 Jul 30, 2024
5fc91b8
NAS-130055: Change `catalog.get_item_details` to `catalog.get_app_det…
RehanY147 Jul 31, 2024
835a750
NAS-130055: Remove catalog API calls
RehanY147 Jul 31, 2024
3e14cf1
NAS-130055: Remove docker images routes for now
RehanY147 Jul 31, 2024
f5e65c2
NAS-130055: Add manage-catalog component
RehanY147 Jul 31, 2024
1a93bc2
Merge branch 'master' into NAS-130055-pt2
RehanY147 Jul 31, 2024
c173622
Merge branch 'master' into NAS-130055-pt2
RehanY147 Aug 1, 2024
f7e2d86
Merge branch 'master' into NAS-130055-pt2
RehanY147 Aug 1, 2024
4af3ca4
NAS-130055: Remove container images related code
RehanY147 Aug 2, 2024
cf53b21
NAS-130055: Fix get-app-details call
RehanY147 Aug 2, 2024
ce04938
NAS-130055: Fixed method call
RehanY147 Aug 2, 2024
74c497c
NAS-130226: Fix App create and update calls
RehanY147 Aug 2, 2024
68474aa
NAS-130226: Fixes app-start and app-stop logic and fix `chart_metadat…
RehanY147 Aug 2, 2024
904d004
NAS-130226: Removes `chart.release` API calls and improves interfaces…
RehanY147 Aug 3, 2024
a65555c
Merge branch 'master' into NAS-130055-pt2
RehanY147 Aug 4, 2024
f930a64
Merge branch 'NAS-130055-pt2' into NAS-130226
RehanY147 Aug 4, 2024
f011e36
NAS-130226: Removes app-history-card related to kubernetes
RehanY147 Aug 5, 2024
431069f
NAS-130226: More clean up
RehanY147 Aug 5, 2024
e280bce
NAS-130226: Fix build issue
RehanY147 Aug 5, 2024
376577f
Merge branch 'master' into NAS-130226
RehanY147 Aug 6, 2024
5cd3b57
NAS-130226: Improves App installation, update, deletion
undsoft Aug 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/app/enums/chart-release-status.enum.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export enum ChartReleaseStatus {
export enum CatalogAppState {
Active = 'ACTIVE',
Deploying = 'DEPLOYING',
Stopped = 'STOPPED',
}

export const chartStatusIcons = new Map<ChartReleaseStatus, string>([
[ChartReleaseStatus.Active, 'mdi-check-circle'],
[ChartReleaseStatus.Deploying, 'mdi-progress-wrench'],
[ChartReleaseStatus.Stopped, 'mdi-stop-circle'],
export const appStateIcons = new Map<CatalogAppState, string>([
[CatalogAppState.Active, 'mdi-check-circle'],
[CatalogAppState.Deploying, 'mdi-progress-wrench'],
[CatalogAppState.Stopped, 'mdi-stop-circle'],
]);
25 changes: 12 additions & 13 deletions src/app/interfaces/api/api-call-directory.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from 'app/interfaces/alert.interface';
import { ApiTimestamp } from 'app/interfaces/api-date.interface';
import { ApiKey, CreateApiKeyRequest, UpdateApiKeyRequest } from 'app/interfaces/api-key.interface';
import { UpgradeSummary } from 'app/interfaces/application.interface';
import { AppUpgradeSummary } from 'app/interfaces/application.interface';
import { AuditConfig, AuditEntry, AuditQueryParams } from 'app/interfaces/audit/audit.interface';
import { AuthSession } from 'app/interfaces/auth-session.interface';
import { LoginQuery } from 'app/interfaces/auth.interface';
Expand All @@ -40,9 +40,6 @@ import {
} from 'app/interfaces/bootenv.interface';
import {
Catalog, CatalogApp,
CatalogItems,
CatalogItemsQueryParams,
CatalogQueryParams,
CatalogUpdate, GetItemDetailsParams,
} from 'app/interfaces/catalog.interface';
import {
Expand All @@ -58,9 +55,9 @@ import {
ChartReleaseEvent,
} from 'app/interfaces/chart-release-event.interface';
import {
ChartRelease,
App,
ChartReleaseQueryParams,
ChartReleaseUpgradeParams,
AppUpgradeParams,
} from 'app/interfaces/chart-release.interface';
import { Choices } from 'app/interfaces/choices.interface';
import {
Expand Down Expand Up @@ -355,11 +352,9 @@ export interface ApiCallDirectory {
'bootenv.update': { params: UpdateBootenvParams; response: string };

// Catalog
'catalog.delete': { params: [name: string]; response: boolean };
'catalog.get_item_details': { params: [name: string, params: GetItemDetailsParams]; response: CatalogApp };
'catalog.items': { params: [label: string, params?: CatalogItemsQueryParams]; response: CatalogItems };
'catalog.query': { params: CatalogQueryParams; response: Catalog[] };
'catalog.update': { params: [id: string, update: CatalogUpdate]; response: Catalog };
'catalog.get_app_details': { params: [name: string, params: GetItemDetailsParams]; response: CatalogApp };
'catalog.update': { params: [CatalogUpdate]; response: Catalog };
'catalog.config': { params: void; response: Catalog };

// Certificate
'certificate.acme_server_choices': { params: void; response: Choices };
Expand All @@ -381,13 +376,17 @@ export interface ApiCallDirectory {
response: CertificateAuthority;
};

// Apps
'app.query': { params: ChartReleaseQueryParams; response: App[] };
'app.upgrade_summary': { params: AppUpgradeParams; response: AppUpgradeSummary };

// Chart
'chart.release.events': { params: [name: string]; response: ChartReleaseEvent[] };
'chart.release.get_chart_releases_using_chart_release_images': { params: [name: string]; response: Choices };
'chart.release.pod_console_choices': { params: [string]; response: Record<string, string[]> };
'chart.release.pod_logs_choices': { params: [string]; response: Record<string, string[]> };
'chart.release.query': { params: ChartReleaseQueryParams; response: ChartRelease[] };
'chart.release.upgrade_summary': { params: ChartReleaseUpgradeParams; response: UpgradeSummary };
'chart.release.query': { params: ChartReleaseQueryParams; response: App[] };
'chart.release.upgrade_summary': { params: AppUpgradeParams; response: AppUpgradeSummary };

// CloudBackup
'cloud_backup.abort': { params: [id: number]; response: void };
Expand Down
5 changes: 3 additions & 2 deletions src/app/interfaces/api/api-event-directory.interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DockerStatusResponse } from 'app/enums/docker-config.interface';
import { FailoverStatus } from 'app/enums/failover-status.enum';
import { Alert } from 'app/interfaces/alert.interface';
import { ChartRelease, ChartStatisticsUpdate } from 'app/interfaces/chart-release.interface';
import { App, ChartStatisticsUpdate } from 'app/interfaces/chart-release.interface';
import { PullContainerImageResponse, PullContainerImageParams, ContainerImage } from 'app/interfaces/container-image.interface';
import { DirectoryServicesState } from 'app/interfaces/directory-services-state.interface';
import { Disk } from 'app/interfaces/disk.interface';
Expand All @@ -20,7 +20,8 @@ import { ZfsSnapshot } from 'app/interfaces/zfs-snapshot.interface';

export interface ApiEventDirectory {
'alert.list': { response: Alert };
'chart.release.query': { response: ChartRelease };
'chart.release.query': { response: App };
'app.query': { response: App };
'chart.release.statistics': { response: ChartStatisticsUpdate[] };
'core.get_jobs': { response: Job };
'directoryservices.status': { response: DirectoryServicesState };
Expand Down
32 changes: 20 additions & 12 deletions src/app/interfaces/api/api-job-directory.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ import { SetAcl } from 'app/interfaces/acl.interface';
import { ActiveDirectoryConfig, LeaveActiveDirectory } from 'app/interfaces/active-directory-config.interface';
import { ActiveDirectoryUpdate } from 'app/interfaces/active-directory.interface';
import { AuditEntry } from 'app/interfaces/audit/audit.interface';
import { Catalog, CatalogCreate } from 'app/interfaces/catalog.interface';
import { Certificate, CertificateCreate, CertificateUpdate } from 'app/interfaces/certificate.interface';
import {
ChartRollbackParams,
ChartScaleQueryParams,
AppStartQueryParams,
ChartScaleResult,
AppDeleteParams,
} from 'app/interfaces/chart-release-event.interface';
import {
ChartRelease,
ChartReleaseCreate,
ChartReleaseUpdate,
ChartReleaseUpgrade,
App,
AppCreate,
AppUpdate,
AppUpgrade,
AppUpgradeParams,
} from 'app/interfaces/chart-release.interface';
import { CloudBackupRestoreParams, CloudBackupSnapshot } from 'app/interfaces/cloud-backup.interface';
import { CloudSyncTaskUpdate } from 'app/interfaces/cloud-sync-task.interface';
Expand Down Expand Up @@ -72,21 +73,28 @@ export interface ApiJobDirectory {
'bootenv.delete': { params: [string]; response: boolean };

// Catalog
'catalog.create': { params: [CatalogCreate]; response: Catalog };
'catalog.sync': { params: [label: string]; response: void };

// Certificate
'certificate.create': { params: [CertificateCreate]; response: Certificate };
'certificate.delete': { params: [id: number, force?: boolean]; response: boolean };
'certificate.update': { params: [id: number, update: CertificateUpdate]; response: Certificate };

// App
'app.create': { params: [AppCreate]; response: App };
'app.update': { params: [string, AppUpdate]; response: App };
'app.start': { params: AppStartQueryParams; response: void };
'app.stop': { params: AppStartQueryParams; response: void };
'app.delete': { params: AppDeleteParams; response: boolean };
'app.upgrade': { params: AppUpgradeParams; response: App };

// Chart Release
'chart.release.create': { params: [ChartReleaseCreate]; response: ChartRelease };
'chart.release.create': { params: [AppCreate]; response: App };
'chart.release.delete': { params: [string, { delete_unused_images: boolean }]; response: boolean };
'chart.release.rollback': { params: [name: string, params: ChartRollbackParams]; response: ChartRelease };
'chart.release.scale': { params: ChartScaleQueryParams; response: ChartScaleResult };
'chart.release.update': { params: [name: string, update: ChartReleaseUpdate]; response: ChartRelease };
'chart.release.upgrade': { params: [name: string, upgrade: ChartReleaseUpgrade]; response: ChartRelease };
'chart.release.rollback': { params: [name: string, params: ChartRollbackParams]; response: App };
'chart.release.scale': { params: AppStartQueryParams; response: ChartScaleResult };
'chart.release.update': { params: [name: string, update: AppUpdate]; response: App };
'chart.release.upgrade': { params: [name: string, upgrade: AppUpgrade]; response: App };

// CloudBackup
'cloud_backup.sync': { params: [id: number, params?: { dry_run: boolean }]; response: void };
Expand Down
15 changes: 5 additions & 10 deletions src/app/interfaces/application.interface.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { ChartContainerImage } from './chart-release.interface';

export interface UpgradeSummary {
export interface AppUpgradeSummary {
latest_version: string;
latest_human_version: string;
upgrade_version: string;
upgrade_human_version: string;
changelog: string;
available_versions_for_upgrade: {
version: string;
human_version: string;
}[];
container_images_to_update: Record<string, ChartContainerImage>;
item_update_available: boolean;
image_update_available: boolean;
latest_version: string;
upgrade_version: string;
latest_human_version: string;
upgrade_human_version: string;
}
53 changes: 1 addition & 52 deletions src/app/interfaces/catalog.interface.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,19 @@
import { JobState } from 'app/enums/job-state.enum';
import { AppMaintainer } from 'app/interfaces/available-app.interface';
import {
AppMetadata, ChartFormValue, ChartSchemaGroup, ChartSchemaNode,
} from 'app/interfaces/chart-release.interface';
import { QueryParams } from 'app/interfaces/query-api.interface';

export interface Catalog {
branch: string;
builtin: boolean;
healthy: boolean;
id: string;
label: string;

/**
* E.g. "/mnt/pool/ix-applications/catalogs/github_com_truenas_charts_git_master"
*/
location: string;
preferred_trains: string[];

/**
* E.g. https://github.com/truenas/charts.git
*/
repository: string;
trains: Record<string, CatalogTrain>;
error: boolean;
cached: boolean;
caching_job: {
id: number;
abortable: boolean;
method: string;
progress: {
percent: number;
description: string;
};
state: JobState;
};
}

export type CatalogQueryParams = QueryParams<Catalog, {
extra: {
item_details?: boolean;
cache?: boolean;
include_chart_schema?: boolean;
};
}>;

export interface CatalogUpdate {
preferred_trains: string[];
}

export interface CatalogCreate {
label: string;
repository: string;
branch: string;
preferred_trains: string[];
force: boolean;
}

export type CatalogTrain = Record<string, CatalogApp>;

export interface CatalogApp {
Expand Down Expand Up @@ -94,7 +51,7 @@ export interface CatalogApp {
export interface CatalogAppVersion {
app_readme: string;
changelog: string;
chart_metadata: ChartMetadata;
metadata: ChartMetadata;
detailed_readme: string;
healthy: boolean;
healthy_error: string;
Expand Down Expand Up @@ -144,14 +101,6 @@ export interface ChartMetadataDependency {

export type CatalogItems = Record<string, CatalogTrain>;

export interface CatalogItemsQueryParams {
cache?: boolean;
cache_only?: boolean;
retrieve_all_trains?: boolean;
retrieve_versions?: boolean;
trains?: string[];
}

export interface GetItemDetailsParams {
cache?: boolean;
catalog?: string;
Expand Down
13 changes: 9 additions & 4 deletions src/app/interfaces/chart-release-event.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ export interface ChartReleaseEventObject {
uid: string;
}

export type ChartScaleQueryParams = [
export type AppStartQueryParams = [
name: string,
params?: {
replica_count: number;
];

export type AppDeleteParams = [
string,
{
remove_images?: boolean;
remove_ix_volumes?: boolean;
},
];

Expand All @@ -49,7 +54,7 @@ export interface ChartRollbackParams {
force_rollback?: boolean;
recreate_resources?: boolean;
rollback_snapshot?: boolean;
item_version: string;
app_version: string;
}

export interface ChartEventMetadata {
Expand Down
Loading