Buckets:

HuggingFaceDocBuilder's picture
download
raw
14.8 kB
import{s as ct,n as $t,o as dt}from"../chunks/scheduler.2b22cead.js";import{S as ut,i as gt,e as c,s as i,c as a,h as ht,a as $,d as l,b as s,f as ot,g as p,j as d,k as ft,l as yt,m as n,n as m,t as r,o,p as f}from"../chunks/index.1a0e8013.js";import{C as vt,H as u}from"../chunks/Heading.8250c9c7.js";import{C as g}from"../chunks/CodeBlock.acc2b0c1.js";import{E as wt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.5df0e759.js";function Mt(Ae){let h,se,ne,ae,y,pe,v,me,w,Re="Deploy your OpenEnv environments to Hugging Face Spaces or a custom Docker registry using the <code>openenv push</code> command.",re,M,oe,b,ze="From inside an environment directory (must contain <code>openenv.yaml</code>):",fe,T,ce,U,De="This builds the Docker image, packages the environment, and pushes it to a Hugging Face Space. The Space name defaults to <code>&lt;your-hf-username&gt;/&lt;env-name&gt;</code> from <code>openenv.yaml</code>; override it with <code>--repo-id</code>:",$e,j,de,B,ue,J,qe="Test your environment locally before pushing:",ge,C,he,S,ye,H,Oe="Once satisfied, <code>openenv push</code> deploys the same image to HF Spaces.",ve,L,we,I,Me,k,Ke="Pass runtime configuration at push time:",be,x,Te,_,et="Both flags are repeatable. For defaults that belong with the environment, declare them in <code>openenv.yaml</code> under <code>variables:</code> — <code>openenv push</code> applies them automatically and CLI <code>-e</code> overrides matching keys. Secrets should only ever be passed via <code>--secret</code>, never committed to <code>openenv.yaml</code>.",Ue,Q,tt='See the <a href="../getting_started/environment-builder">environment builder guide</a> for the full <code>variables:</code> reference.',je,W,Be,Z,lt="Request a specific accelerator for the Space:",Je,E,Ce,P,nt='See the <a href="https://huggingface.co/docs/hub/spaces-gpus" rel="nofollow">HF Spaces hardware docs</a> for available tiers.',Se,N,He,X,Le,F,Ie,G,it=`Deploy <code>N</code> copies of the same environment, each with a numeric suffix
(<code>my-env-1</code>, <code>my-env-2</code>, …):`,ke,V,xe,Y,st="Useful for load distribution across parallel training runs. Cannot be combined with <code>--registry</code> or <code>--create-pr</code>.",_e,A,Qe,R,at="To review changes before they go live, push to a new branch and open a PR on the Space repo:",We,z,Ze,D,pt='See the <a href="../getting_started/contributing-envs">contributing environments guide</a> for the full PR-based update workflow.',Ee,q,Pe,O,Ne,K,mt="The web interface is disabled by default for custom registry pushes. <code>-e</code>/<code>--env-var</code> and <code>--secret</code> are not available with <code>--registry</code> (HF Space settings only).",Xe,ee,Fe,te,rt='<li><a href="../getting_started/environment-builder">Environment builder</a> — full <code>openenv push</code> flag reference and <code>openenv.yaml</code> <code>variables:</code> docs</li> <li><a href="../getting_started/contributing-envs">Contributing environments</a> — PR-based update workflow and forking existing environments</li> <li><a href="../reference/cli">CLI reference</a> — all CLI commands</li>',Ge,le,Ve,ie,Ye;return y=new vt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),v=new u({props:{title:"Deployment",local:"deployment",headingTag:"h1"}}),M=new u({props:{title:"Quick deploy to Hugging Face Spaces",local:"quick-deploy-to-hugging-face-spaces",headingTag:"h2"}}),T=new g({props:{code:"b3BlbmVudiUyMHB1c2g=",highlighted:"openenv push",lang:"bash",wrap:!1}}),j=new g({props:{code:"b3BlbmVudiUyMHB1c2glMjAtLXJlcG8taWQlMjBteS1vcmclMkZteS1lbnY=",highlighted:"openenv push --repo-id my-org/my-env",lang:"bash",wrap:!1}}),B=new u({props:{title:"Local development workflow",local:"local-development-workflow",headingTag:"h2"}}),C=new g({props:{code:"JTIzJTIwQnVpbGQlMjB0aGUlMjBpbWFnZSUwQW9wZW5lbnYlMjBidWlsZCUwQSUwQSUyMyUyMFJ1biUyMGl0JTIwbG9jYWxseSUwQWRvY2tlciUyMHJ1biUyMC1wJTIwODAwMCUzQTgwMDAlMjBteS1lbnYlM0FsYXRlc3Q=",highlighted:`<span class="hljs-comment"># Build the image</span>
openenv build
<span class="hljs-comment"># Run it locally</span>
docker run -p 8000:8000 my-env:latest`,lang:"bash",wrap:!1}}),S=new g({props:{code:"JTIzJTIwQ29ubmVjdCUyMGElMjBjbGllbnQlMEFmcm9tJTIwb3BlbmVudiUyMGltcG9ydCUyMEF1dG9FbnYlMEFlbnYlMjAlM0QlMjBBdXRvRW52LmZyb21fZW52KCUyMmh0dHAlM0ElMkYlMkZsb2NhbGhvc3QlM0E4MDAwJTIyKQ==",highlighted:`<span class="hljs-comment"># Connect a client</span>
<span class="hljs-keyword">from</span> openenv <span class="hljs-keyword">import</span> AutoEnv
env = AutoEnv.from_env(<span class="hljs-string">&quot;http://localhost:8000&quot;</span>)`,lang:"python",wrap:!1}}),L=new u({props:{title:"Configuring the Space",local:"configuring-the-space",headingTag:"h2"}}),I=new u({props:{title:"Public variables and private secrets",local:"public-variables-and-private-secrets",headingTag:"h3"}}),x=new g({props:{code:"JTIzJTIwUHVibGljJTIwU3BhY2UlMjB2YXJpYWJsZSUyMCh2aXNpYmxlJTIwaW4lMjBTcGFjZSUyMHNldHRpbmdzKSUwQW9wZW5lbnYlMjBwdXNoJTIwLWUlMjBNT0RFTF9OQU1FJTNEUXdlbjMtMS43QiUwQSUwQSUyMyUyMFByaXZhdGUlMjBzZWNyZXQlMjAobmV2ZXIlMjBsb2dnZWQlMkMlMjBzdG9yZWQlMjBlbmNyeXB0ZWQpJTBBb3BlbmVudiUyMHB1c2glMjAtLXNlY3JldCUyME9QRU5BSV9BUElfS0VZJTNEc2stLi4uJTBBJTBBJTIzJTIwQm90aCUyMGF0JTIwb25jZSUwQW9wZW5lbnYlMjBwdXNoJTIwLWUlMjBEQVRBU0VUJTNEY2hhaW5fc3VtJTIwLS1zZWNyZXQlMjBIRl9UT0tFTiUzRGhmXy4uLg==",highlighted:`<span class="hljs-comment"># Public Space variable (visible in Space settings)</span>
openenv push -e MODEL_NAME=Qwen3-1.7B
<span class="hljs-comment"># Private secret (never logged, stored encrypted)</span>
openenv push --secret OPENAI_API_KEY=sk-...
<span class="hljs-comment"># Both at once</span>
openenv push -e DATASET=chain_sum --secret HF_TOKEN=hf_...`,lang:"bash",wrap:!1}}),W=new u({props:{title:"Hardware",local:"hardware",headingTag:"h3"}}),E=new g({props:{code:"b3BlbmVudiUyMHB1c2glMjAtLWhhcmR3YXJlJTIwdDQtbWVkaXVtJTIwJTIwJTIwJTIzJTIwTlZJRElBJTIwVDQlMEFvcGVuZW52JTIwcHVzaCUyMC0taGFyZHdhcmUlMjBhMTBnLXNtYWxsJTIwJTIwJTIzJTIwTlZJRElBJTIwQTEwRyUwQW9wZW5lbnYlMjBwdXNoJTIwLS1oYXJkd2FyZSUyMGNwdS1iYXNpYyUyMCUyMCUyMCUyMyUyMENQVS1vbmx5JTIwKGRlZmF1bHQp",highlighted:`openenv push --hardware t4-medium <span class="hljs-comment"># NVIDIA T4</span>
openenv push --hardware a10g-small <span class="hljs-comment"># NVIDIA A10G</span>
openenv push --hardware cpu-basic <span class="hljs-comment"># CPU-only (default)</span>`,lang:"bash",wrap:!1}}),N=new u({props:{title:"Visibility",local:"visibility",headingTag:"h3"}}),X=new g({props:{code:"b3BlbmVudiUyMHB1c2glMjAtLXByaXZhdGUlMjAlMjAlMjAlMjMlMjBkZXBsb3klMjBhcyUyMGElMjBwcml2YXRlJTIwU3BhY2U=",highlighted:'openenv push --private <span class="hljs-comment"># deploy as a private Space</span>',lang:"bash",wrap:!1}}),F=new u({props:{title:"Multiple instances",local:"multiple-instances",headingTag:"h3"}}),V=new g({props:{code:"b3BlbmVudiUyMHB1c2glMjAtLWNvdW50JTIwMyUyMCUyMCUyMCUyMyUyMGRlcGxveXMlMjBteS1lbnYtMSUyQyUyMG15LWVudi0yJTJDJTIwbXktZW52LTM=",highlighted:'openenv push --count 3 <span class="hljs-comment"># deploys my-env-1, my-env-2, my-env-3</span>',lang:"bash",wrap:!1}}),A=new u({props:{title:"Staging changes with a pull request",local:"staging-changes-with-a-pull-request",headingTag:"h2"}}),z=new g({props:{code:"b3BlbmVudiUyMHB1c2glMjAtLWNyZWF0ZS1wcg==",highlighted:"openenv push --create-pr",lang:"bash",wrap:!1}}),q=new u({props:{title:"Pushing to a custom Docker registry",local:"pushing-to-a-custom-docker-registry",headingTag:"h2"}}),O=new g({props:{code:"b3BlbmVudiUyMHB1c2glMjAtLXJlZ2lzdHJ5JTIwZ2hjci5pbyUyRm15LW9yZyUwQW9wZW5lbnYlMjBwdXNoJTIwLS1yZWdpc3RyeSUyMGRvY2tlci5pbyUyRm15dXNlcg==",highlighted:`openenv push --registry ghcr.io/my-org
openenv push --registry docker.io/myuser`,lang:"bash",wrap:!1}}),ee=new u({props:{title:"Next Steps",local:"next-steps",headingTag:"h2"}}),le=new wt({props:{source:"https://github.com/huggingface/openenv/blob/main/docs/source/guides/deployment.md"}}),{c(){h=c("meta"),se=i(),ne=c("p"),ae=i(),a(y.$$.fragment),pe=i(),a(v.$$.fragment),me=i(),w=c("p"),w.innerHTML=Re,re=i(),a(M.$$.fragment),oe=i(),b=c("p"),b.innerHTML=ze,fe=i(),a(T.$$.fragment),ce=i(),U=c("p"),U.innerHTML=De,$e=i(),a(j.$$.fragment),de=i(),a(B.$$.fragment),ue=i(),J=c("p"),J.textContent=qe,ge=i(),a(C.$$.fragment),he=i(),a(S.$$.fragment),ye=i(),H=c("p"),H.innerHTML=Oe,ve=i(),a(L.$$.fragment),we=i(),a(I.$$.fragment),Me=i(),k=c("p"),k.textContent=Ke,be=i(),a(x.$$.fragment),Te=i(),_=c("p"),_.innerHTML=et,Ue=i(),Q=c("p"),Q.innerHTML=tt,je=i(),a(W.$$.fragment),Be=i(),Z=c("p"),Z.textContent=lt,Je=i(),a(E.$$.fragment),Ce=i(),P=c("p"),P.innerHTML=nt,Se=i(),a(N.$$.fragment),He=i(),a(X.$$.fragment),Le=i(),a(F.$$.fragment),Ie=i(),G=c("p"),G.innerHTML=it,ke=i(),a(V.$$.fragment),xe=i(),Y=c("p"),Y.innerHTML=st,_e=i(),a(A.$$.fragment),Qe=i(),R=c("p"),R.textContent=at,We=i(),a(z.$$.fragment),Ze=i(),D=c("p"),D.innerHTML=pt,Ee=i(),a(q.$$.fragment),Pe=i(),a(O.$$.fragment),Ne=i(),K=c("p"),K.innerHTML=mt,Xe=i(),a(ee.$$.fragment),Fe=i(),te=c("ul"),te.innerHTML=rt,Ge=i(),a(le.$$.fragment),Ve=i(),ie=c("p"),this.h()},l(e){const t=ht("svelte-u9bgzb",document.head);h=$(t,"META",{name:!0,content:!0}),t.forEach(l),se=s(e),ne=$(e,"P",{}),ot(ne).forEach(l),ae=s(e),p(y.$$.fragment,e),pe=s(e),p(v.$$.fragment,e),me=s(e),w=$(e,"P",{"data-svelte-h":!0}),d(w)!=="svelte-ddgjah"&&(w.innerHTML=Re),re=s(e),p(M.$$.fragment,e),oe=s(e),b=$(e,"P",{"data-svelte-h":!0}),d(b)!=="svelte-7qcj4u"&&(b.innerHTML=ze),fe=s(e),p(T.$$.fragment,e),ce=s(e),U=$(e,"P",{"data-svelte-h":!0}),d(U)!=="svelte-1ff8x99"&&(U.innerHTML=De),$e=s(e),p(j.$$.fragment,e),de=s(e),p(B.$$.fragment,e),ue=s(e),J=$(e,"P",{"data-svelte-h":!0}),d(J)!=="svelte-th0m5t"&&(J.textContent=qe),ge=s(e),p(C.$$.fragment,e),he=s(e),p(S.$$.fragment,e),ye=s(e),H=$(e,"P",{"data-svelte-h":!0}),d(H)!=="svelte-18e0zt1"&&(H.innerHTML=Oe),ve=s(e),p(L.$$.fragment,e),we=s(e),p(I.$$.fragment,e),Me=s(e),k=$(e,"P",{"data-svelte-h":!0}),d(k)!=="svelte-17hf2wn"&&(k.textContent=Ke),be=s(e),p(x.$$.fragment,e),Te=s(e),_=$(e,"P",{"data-svelte-h":!0}),d(_)!=="svelte-1aevnl9"&&(_.innerHTML=et),Ue=s(e),Q=$(e,"P",{"data-svelte-h":!0}),d(Q)!=="svelte-y3pa2a"&&(Q.innerHTML=tt),je=s(e),p(W.$$.fragment,e),Be=s(e),Z=$(e,"P",{"data-svelte-h":!0}),d(Z)!=="svelte-9zrw6n"&&(Z.textContent=lt),Je=s(e),p(E.$$.fragment,e),Ce=s(e),P=$(e,"P",{"data-svelte-h":!0}),d(P)!=="svelte-irzyln"&&(P.innerHTML=nt),Se=s(e),p(N.$$.fragment,e),He=s(e),p(X.$$.fragment,e),Le=s(e),p(F.$$.fragment,e),Ie=s(e),G=$(e,"P",{"data-svelte-h":!0}),d(G)!=="svelte-pxs8ao"&&(G.innerHTML=it),ke=s(e),p(V.$$.fragment,e),xe=s(e),Y=$(e,"P",{"data-svelte-h":!0}),d(Y)!=="svelte-1uw2hd7"&&(Y.innerHTML=st),_e=s(e),p(A.$$.fragment,e),Qe=s(e),R=$(e,"P",{"data-svelte-h":!0}),d(R)!=="svelte-dlc5v9"&&(R.textContent=at),We=s(e),p(z.$$.fragment,e),Ze=s(e),D=$(e,"P",{"data-svelte-h":!0}),d(D)!=="svelte-1j8if7d"&&(D.innerHTML=pt),Ee=s(e),p(q.$$.fragment,e),Pe=s(e),p(O.$$.fragment,e),Ne=s(e),K=$(e,"P",{"data-svelte-h":!0}),d(K)!=="svelte-e99ipd"&&(K.innerHTML=mt),Xe=s(e),p(ee.$$.fragment,e),Fe=s(e),te=$(e,"UL",{"data-svelte-h":!0}),d(te)!=="svelte-jjhqqs"&&(te.innerHTML=rt),Ge=s(e),p(le.$$.fragment,e),Ve=s(e),ie=$(e,"P",{}),ot(ie).forEach(l),this.h()},h(){ft(h,"name","hf:doc:metadata"),ft(h,"content",bt)},m(e,t){yt(document.head,h),n(e,se,t),n(e,ne,t),n(e,ae,t),m(y,e,t),n(e,pe,t),m(v,e,t),n(e,me,t),n(e,w,t),n(e,re,t),m(M,e,t),n(e,oe,t),n(e,b,t),n(e,fe,t),m(T,e,t),n(e,ce,t),n(e,U,t),n(e,$e,t),m(j,e,t),n(e,de,t),m(B,e,t),n(e,ue,t),n(e,J,t),n(e,ge,t),m(C,e,t),n(e,he,t),m(S,e,t),n(e,ye,t),n(e,H,t),n(e,ve,t),m(L,e,t),n(e,we,t),m(I,e,t),n(e,Me,t),n(e,k,t),n(e,be,t),m(x,e,t),n(e,Te,t),n(e,_,t),n(e,Ue,t),n(e,Q,t),n(e,je,t),m(W,e,t),n(e,Be,t),n(e,Z,t),n(e,Je,t),m(E,e,t),n(e,Ce,t),n(e,P,t),n(e,Se,t),m(N,e,t),n(e,He,t),m(X,e,t),n(e,Le,t),m(F,e,t),n(e,Ie,t),n(e,G,t),n(e,ke,t),m(V,e,t),n(e,xe,t),n(e,Y,t),n(e,_e,t),m(A,e,t),n(e,Qe,t),n(e,R,t),n(e,We,t),m(z,e,t),n(e,Ze,t),n(e,D,t),n(e,Ee,t),m(q,e,t),n(e,Pe,t),m(O,e,t),n(e,Ne,t),n(e,K,t),n(e,Xe,t),m(ee,e,t),n(e,Fe,t),n(e,te,t),n(e,Ge,t),m(le,e,t),n(e,Ve,t),n(e,ie,t),Ye=!0},p:$t,i(e){Ye||(r(y.$$.fragment,e),r(v.$$.fragment,e),r(M.$$.fragment,e),r(T.$$.fragment,e),r(j.$$.fragment,e),r(B.$$.fragment,e),r(C.$$.fragment,e),r(S.$$.fragment,e),r(L.$$.fragment,e),r(I.$$.fragment,e),r(x.$$.fragment,e),r(W.$$.fragment,e),r(E.$$.fragment,e),r(N.$$.fragment,e),r(X.$$.fragment,e),r(F.$$.fragment,e),r(V.$$.fragment,e),r(A.$$.fragment,e),r(z.$$.fragment,e),r(q.$$.fragment,e),r(O.$$.fragment,e),r(ee.$$.fragment,e),r(le.$$.fragment,e),Ye=!0)},o(e){o(y.$$.fragment,e),o(v.$$.fragment,e),o(M.$$.fragment,e),o(T.$$.fragment,e),o(j.$$.fragment,e),o(B.$$.fragment,e),o(C.$$.fragment,e),o(S.$$.fragment,e),o(L.$$.fragment,e),o(I.$$.fragment,e),o(x.$$.fragment,e),o(W.$$.fragment,e),o(E.$$.fragment,e),o(N.$$.fragment,e),o(X.$$.fragment,e),o(F.$$.fragment,e),o(V.$$.fragment,e),o(A.$$.fragment,e),o(z.$$.fragment,e),o(q.$$.fragment,e),o(O.$$.fragment,e),o(ee.$$.fragment,e),o(le.$$.fragment,e),Ye=!1},d(e){e&&(l(se),l(ne),l(ae),l(pe),l(me),l(w),l(re),l(oe),l(b),l(fe),l(ce),l(U),l($e),l(de),l(ue),l(J),l(ge),l(he),l(ye),l(H),l(ve),l(we),l(Me),l(k),l(be),l(Te),l(_),l(Ue),l(Q),l(je),l(Be),l(Z),l(Je),l(Ce),l(P),l(Se),l(He),l(Le),l(Ie),l(G),l(ke),l(xe),l(Y),l(_e),l(Qe),l(R),l(We),l(Ze),l(D),l(Ee),l(Pe),l(Ne),l(K),l(Xe),l(Fe),l(te),l(Ge),l(Ve),l(ie)),l(h),f(y,e),f(v,e),f(M,e),f(T,e),f(j,e),f(B,e),f(C,e),f(S,e),f(L,e),f(I,e),f(x,e),f(W,e),f(E,e),f(N,e),f(X,e),f(F,e),f(V,e),f(A,e),f(z,e),f(q,e),f(O,e),f(ee,e),f(le,e)}}}const bt='{"title":"Deployment","local":"deployment","sections":[{"title":"Quick deploy to Hugging Face Spaces","local":"quick-deploy-to-hugging-face-spaces","sections":[],"depth":2},{"title":"Local development workflow","local":"local-development-workflow","sections":[],"depth":2},{"title":"Configuring the Space","local":"configuring-the-space","sections":[{"title":"Public variables and private secrets","local":"public-variables-and-private-secrets","sections":[],"depth":3},{"title":"Hardware","local":"hardware","sections":[],"depth":3},{"title":"Visibility","local":"visibility","sections":[],"depth":3},{"title":"Multiple instances","local":"multiple-instances","sections":[],"depth":3}],"depth":2},{"title":"Staging changes with a pull request","local":"staging-changes-with-a-pull-request","sections":[],"depth":2},{"title":"Pushing to a custom Docker registry","local":"pushing-to-a-custom-docker-registry","sections":[],"depth":2},{"title":"Next Steps","local":"next-steps","sections":[],"depth":2}],"depth":1}';function Tt(Ae){return dt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class St extends ut{constructor(h){super(),gt(this,h,Tt,Mt,ct,{})}}export{St as component};

Xet Storage Details

Size:
14.8 kB
·
Xet hash:
760c4b5cd479a8628aad3c284b51900a7e312a683c722935ce1b040846088409

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.