File tree Expand file tree Collapse file tree 6 files changed +27
-53
lines changed
Expand file tree Collapse file tree 6 files changed +27
-53
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import {
2121import { handleNodesError , nodesClient } from "../../nodesClient.ts" ;
2222import { getPricePerGpuHourFromQuote , getQuote } from "../buy/index.tsx" ;
2323import { GPUS_PER_NODE } from "../constants.ts" ;
24- import { isFeatureEnabled } from "../posthog.ts" ;
2524import {
2625 createNodesTable ,
2726 durationOption ,
@@ -130,6 +129,12 @@ const create = new Command("create")
130129 }
131130 } ) ,
132131 )
132+ . addOption (
133+ new Option (
134+ "-i, --image <image-id>" ,
135+ "ID of the VM image to boot on the nodes. View available images with `sf node images list`." ,
136+ ) ,
137+ )
133138 . addOption ( yesOption )
134139 . addOption ( jsonOption )
135140 . hook ( "preAction" , ( command ) => {
@@ -492,18 +497,4 @@ async function createNodesAction(
492497 }
493498}
494499
495- // Remove this once the feature flag is enabled by default
496- export async function addCreate ( program : Command ) {
497- const imagesEnabled = await isFeatureEnabled ( "custom-vm-images" ) ;
498- if ( imagesEnabled ) {
499- create . addOption (
500- new Option (
501- "-i, --image <image-id>" ,
502- "ID of the VM image to boot on the nodes. View available images with `sf node images list`." ,
503- ) ,
504- ) ;
505- }
506- program . addCommand ( create ) ;
507- }
508-
509500export default create ;
Original file line number Diff line number Diff line change 11import { Command } from "@commander-js/extra-typings" ;
2- import { isFeatureEnabled } from "../../posthog.ts" ;
32import list from "./list.tsx" ;
43import show from "./show.tsx" ;
54import upload from "./upload.ts" ;
@@ -30,11 +29,4 @@ Examples:\n
3029 image . help ( ) ;
3130 } ) ;
3231
33- export async function addImage ( program : Command ) {
34- const imagesEnabled = await isFeatureEnabled ( "custom-vm-images" ) ;
35- if ( imagesEnabled ) {
36- program . addCommand ( image ) ;
37- }
38- }
39-
4032export default image ;
Original file line number Diff line number Diff line change 11import console from "node:console" ;
22import type { Command } from "@commander-js/extra-typings" ;
33
4- import { addCreate } from "./create.ts" ;
4+ import create from "./create.ts" ;
55import deleteCommand from "./delete.ts" ;
66import extend from "./extend.ts" ;
77import get from "./get.tsx" ;
8- import { addImage } from "./image/index.ts" ;
8+ import image from "./image/index.ts" ;
99import list from "./list.tsx" ;
1010import logs from "./logs.ts" ;
11- import { addRedeploy } from "./redeploy.ts" ;
11+ import redeploy from "./redeploy.ts" ;
1212import release from "./release.ts" ;
1313import set from "./set.ts" ;
1414import ssh from "./ssh.ts" ;
1515
16- export async function registerNodes ( program : Command ) {
16+ export function registerNodes ( program : Command ) {
1717 const nodes = program
1818 . command ( "nodes" )
1919 . alias ( "node" )
2020 . showHelpAfterError ( )
2121 . description ( "Manage compute nodes" )
2222 . addCommand ( list )
2323 . addCommand ( get )
24+ . addCommand ( create )
2425 . addCommand ( extend )
2526 . addCommand ( release )
2627 . addCommand ( deleteCommand )
28+ . addCommand ( redeploy )
2729 . addCommand ( set )
2830 . addCommand ( ssh )
29- . addCommand ( logs ) ;
30-
31- await addImage ( nodes ) ;
32- await addCreate ( nodes ) ;
33- await addRedeploy ( nodes ) ;
31+ . addCommand ( logs )
32+ . addCommand ( image ) ;
3433
3534 const baseHelpText = nodes . helpInformation ( ) ;
3635
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import chalk from "chalk";
88import ora from "ora" ;
99
1010import { handleNodesError , nodesClient } from "../../nodesClient.ts" ;
11- import { isFeatureEnabled } from "../posthog.ts" ;
1211import {
1312 createNodesTable ,
1413 jsonOption ,
@@ -50,6 +49,12 @@ const redeploy = new Command("redeploy")
5049 "If set, any configuration left empty will be cleared in the new VM (default: inherits from current VM)" ,
5150 ) ,
5251 )
52+ . addOption (
53+ new Option (
54+ "-i, --image <image-id>" ,
55+ "ID of the VM image to use for the new VM (inherits from current VM if not specified)" ,
56+ ) ,
57+ )
5358 . addOption ( yesOption )
5459 . addOption ( jsonOption )
5560 . addHelpText (
@@ -288,18 +293,4 @@ async function redeployNodeAction(
288293 }
289294}
290295
291- // Remove this once the feature flag is enabled by default
292- export async function addRedeploy ( program : Command ) {
293- const imagesEnabled = await isFeatureEnabled ( "custom-vm-images" ) ;
294- if ( imagesEnabled ) {
295- redeploy . addOption (
296- new Option (
297- "-i, --image <image-id>" ,
298- "ID of the VM image to use for the new VM (inherits from current VM if not specified)" ,
299- ) ,
300- ) ;
301- }
302- program . addCommand ( redeploy ) ;
303- }
304-
305296export default redeploy ;
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ const trackEvent = ({
6262 }
6363} ;
6464
65- type FeatureFlags = "procurements" | "zones" | "custom-vm-images" ;
65+ type FeatureFlags = "procurements" | "zones" ;
6666
6767/**
6868 * Checks if a feature is enabled for the current user.
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { Command } from "@commander-js/extra-typings";
33import boxen from "boxen" ;
44import chalk from "chalk" ;
55import { nodesClient } from "../../nodesClient.ts" ;
6- import { addImage } from "../nodes/image/index.ts" ;
6+ import image from "../nodes/image/index.ts" ;
77import { pluralizeNodes } from "../nodes/utils.ts" ;
88import list from "./list.ts" ;
99import logs from "./logs.ts" ;
@@ -62,8 +62,9 @@ export async function registerVM(program: Command) {
6262
6363 registerSsh ( vm ) ;
6464
65- vm . addCommand ( list ) . addCommand ( logs ) . addCommand ( replace ) . addCommand ( script ) ;
66-
67- // Add images command if feature flag is enabled
68- await addImage ( vm ) ;
65+ vm . addCommand ( list )
66+ . addCommand ( logs )
67+ . addCommand ( replace )
68+ . addCommand ( script )
69+ . addCommand ( image ) ;
6970}
You can’t perform that action at this time.
0 commit comments