phala 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -55,9 +55,9 @@ services:
55
55
  volumes:
56
56
  - postgres-data:/var/lib/postgresql/data:rw
57
57
  ports:
58
- - "127.0.0.1:5432:5432"
58
+ - '127.0.0.1:5432:5432'
59
59
  healthcheck:
60
- test: ["CMD-SHELL", "pg_isready -U \${POSTGRES_USER} -d \${POSTGRES_DB}"]
60
+ test: ['CMD-SHELL', 'pg_isready -U $\${POSTGRES_USER} -d $\${POSTGRES_DB}']
61
61
  interval: 5s
62
62
  timeout: 5s
63
63
  retries: 5
@@ -73,7 +73,8 @@ services:
73
73
  {{#each envVars}} - {{{this}}}
74
74
  {{/each}}
75
75
  ports:
76
- - "3000:3000"
76
+ - '3000:3000'
77
+ - '50000-50100:50000-50100/udp'
77
78
  depends_on:
78
79
  postgres:
79
80
  condition: service_healthy
@@ -133,5 +134,5 @@ services:
133
134
  - "80:80"
134
135
  `,pr={jupyter:{compose:$o,name:"Jupyter Notebook"},httpbin:{compose:Po,name:"HTTPBin"}};import{encryptEnvVars as Ao}from"@phala/dstack-sdk/encrypt-env-vars";import dr from"inquirer";import Io from"node:crypto";var ur=new Do().name("demo").description("Demo commands to launch a demo on Phala Cloud").action(async()=>{try{await Z()||(r.error("You need to be logged in to use the demo command"),r.info("Please login with: phala auth login"),process.exit(1));try{let g=r.startSpinner("Verifying your credentials"),d=await W();g.stop(!0),r.success(`Logged in as ${d.username}`)}catch{r.error("Authentication failed. Your API key may be invalid or expired."),r.info("Please set a new API key with: phala auth login"),process.exit(1)}let e=Object.values(pr);e.length===0&&(r.error("No template files found in the templates directory"),process.exit(1));let{selectedTemplate:o}=await dr.prompt([{type:"list",name:"selectedTemplate",message:"Select a template to deploy:",choices:e.map(g=>({name:g.name,value:g}))}]),n=o.compose;r.success(`Selected template: ${o.name}`);let s=Io.randomBytes(16).toString("hex"),c=H([`TOKEN=${s}`],""),{cvmName:a}=await dr.prompt([{type:"input",name:"cvmName",message:"Enter a name for your CVM:",default:`${o.name.replace(" ","-")}`,validate:g=>g.trim()?!0:"CVM name is required"}]);r.info("Preparing to deploy your CVM...");let u={teepod_id:3,name:a,image:ae,vcpu:2,memory:2048,disk_size:20,compose_manifest:{docker_compose_file:n,docker_config:{url:"",username:"",password:""},features:["kms","tproxy-net"],kms_enabled:!0,manifest_version:2,name:a,public_logs:!0,public_sysinfo:!0,tproxy_enabled:!0},listed:!1},y=r.startSpinner("Preparing CVM configuration"),p=await Ee(u);y.stop(!0),p||(r.error("Failed to prepare CVM configuration"),process.exit(1));let b=await Ao(c,p.app_env_encrypt_pubkey);r.debug("Public key:",p.app_env_encrypt_pubkey),r.debug("Encrypted environment variables:",b);let k=r.startSpinner("Creating your demo CVM"),m=await xe({...u,encrypted_env:b,app_env_encrypt_pubkey:p.app_env_encrypt_pubkey,app_id_salt:p.app_id_salt});k.stop(!0),m||(r.error("Failed to create demo CVM"),process.exit(1)),r.success("Demo CVM created successfully! \u{1F389}"),r.break();let l={"CVM ID":m.id,Name:m.name,Status:m.status,"App ID":`app_${m.app_id}`,"App URL":m.app_url?m.app_url:`${w}/dashboard/cvms/app_${m.app_id}`,Template:o.name,Resources:"2 vCPUs, 2GB RAM, 20GB Storage"};o.name.includes("Jupyter Notebook")&&(l["Jupyter Token"]=s,l["Access Instructions"]="Access your Jupyter notebook using the token above. Go to 'Network' tab to see the public URL."),r.keyValueTable(l,{borderStyle:"rounded"}),r.break(),r.success(`Your demo is being created. You can check its status with:
135
136
  phala cvms get app_${m.app_id}`)}catch(t){r.error(`Failed to launch demo: ${t instanceof Error?t.message:String(t)}`),process.exit(1)}});process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));async function Fo(){new Ro().name("phala").alias("pha").description(`${be}
136
- Phala Cloud CLI - Manage your Phala Cloud Deployments`).version("v1.0.13").addCommand(Ct).addCommand(ar).addCommand(Mt).addCommand(Nt).addCommand(ur).addCommand(lr).parse(process.argv)}Fo().catch(t=>{r.error("An error occurred:",t),process.exit(1)});
137
+ Phala Cloud CLI - Manage your Phala Cloud Deployments`).version("v1.0.14").addCommand(Ct).addCommand(ar).addCommand(Mt).addCommand(Nt).addCommand(ur).addCommand(lr).parse(process.argv)}Fo().catch(t=>{r.error("An error occurred:",t),process.exit(1)});
137
138
  //# sourceMappingURL=index.js.map