import{s as wt,n as vt,o as bt}from"../chunks/scheduler.9cda857a.js";import{S as Lt,i as Mt,e as l,s as a,c as u,h as xt,a as s,d as n,b as i,f as yt,g as c,j as r,k as G,l as $t,m as o,n as p,t as h,o as f,p as m}from"../chunks/index.003612b0.js";import{C as Ct}from"../chunks/CopyLLMTxtMenu.44d08a39.js";import{C as Tt}from"../chunks/CodeBlock.a90632f1.js";import{H as ee,E as kt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e5cfda8c.js";function Ht(je){let d,oe,te,ae,L,ie,M,le,x,Ae='<a href="https://github.com/zenml-io/zenml" rel="nofollow">ZenML</a> is an extensible, open-source MLOps framework for creating portable, production-ready MLOps pipelines. It’s built for Data Scientists, ML Engineers, and MLOps Developers to collaborate as they develop to production.',se,$,Ne=`ZenML offers a simple and flexible syntax, is cloud- and tool-agnostic, and has
interfaces/abstractions catered toward ML workflows. With ZenML you’ll have all
your favorite tools in one place, so you can tailor a workflow that caters to
your specific needs.`,re,C,Be=`The ZenML Huggingface Space allows you to get up and running with a deployed version
of ZenML with just a few clicks. Within a few minutes, you’ll have this default
ZenML dashboard deployed and ready for you to connect to from your local
machine.`,ue,T,Qe=`In the sections that follow, you’ll learn to deploy your own instance of ZenML and use
it to view and manage your machine learning pipelines right from the Hub. ZenML
on Huggingface Spaces is a <strong>self-contained application completely hosted on the
Hub using Docker</strong>. The diagram below illustrates the complete process.`,ce,k,Ve='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/zenml/hf_spaces_chart.png" alt="ZenML on HuggingFace Spaces -- default deployment"/>',pe,H,We=`Visit <a href="https://docs.zenml.io/" rel="nofollow">the ZenML documentation</a> to learn more about its
features and how to get started with running your machine learning pipelines
through your Huggingface Spaces deployment. You can check out <a href="https://github.com/zenml-io/zenml/tree/main/examples" rel="nofollow">some small sample
examples</a> of ZenML pipelines to get started or take your pick of some more
complex production-grade projects at <a href="https://github.com/zenml-io/zenml-projects" rel="nofollow">the ZenML Projects
repository</a>. ZenML integrates with
many of your favorite tools out of the box, <a href="https://zenml.io/integrations/huggingface" rel="nofollow">including
Huggingface</a> of course! If there’s
something else you want to use, we’re built to be extensible and you can easily
make it work with whatever your custom tool or workflow is.`,he,S,fe,_,Je="You can deploy ZenML on Spaces with just a few clicks:",me,g,Ke='<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/deploy-to-spaces-lg.svg"/>',de,Z,Xe=`To set up your ZenML app, you need to specify three main components: the Owner
(either your personal account or an organization), a Space name, and the
Visibility (a bit lower down the page). Note that the space visibility needs to
be set to ‘Public’ if you wish to connect to the ZenML server from your local
machine.`,ge,z,Ge='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/zenml/choose_space.png" alt="Choose the ZenML Docker template"/>',ye,P,et=`You have the option here to select a higher tier machine to use for your server.
The advantage of selecting a paid CPU instance is that it is not subject to
auto-shutdown policies and thus will stay up as long as you leave it up. In
order to make use of a persistent CPU, you’ll likely want to create and set up a
MySQL database to connect to (see below).`,we,U,tt=`To personalize your Space’s appearance, such as the title, emojis, and colors,
navigate to “Files and Versions” and modify the metadata in your README.md file.
Full information on Spaces configuration parameters can be found on the
HuggingFace <a href="https://huggingface.co/docs/hub/spaces-config-reference" rel="nofollow">documentation reference guide</a>.`,ve,E,nt=`After creating your Space, you’ll notice a ‘Building’ status along with logs
displayed on the screen. When this switches to ‘Running’, your Space is ready for use. If the
ZenML login UI isn’t visible, try refreshing the page.`,be,R,ot=`In the upper-right hand corner of your space you’ll see a button with three dots
which, when you click on it, will offer you a menu option to “Embed this Space”.
(See <a href="https://huggingface.co/docs/hub/spaces-embed" rel="nofollow">the HuggingFace
documentation</a> for more details on
this feature.) Copy the “Direct URL” shown in the box that you can now see on
the screen. This should look something like this:
<code>https://&lt;YOUR_USERNAME&gt;-&lt;SPACE_NAME&gt;.hf.space</code>. Open that URL and use our default
login to access the dashboard (username: ‘default’, password: (leave it empty)).`,Le,D,Me,O,at=`Once you have your ZenML server up and running, you can connect to it from your
local machine. To do this, you’ll need to get your Space’s ‘Direct URL’ (see above).`,xe,y,it=`<p>Your Space’s URL will only be available and usable for connecting from your
local machine if the visibility of the space is set to ‘Public’.</p>`,$e,F,lt=`You can use the ‘Direct URL’ to connect to your ZenML server from your local machine
with the following CLI command (after installing ZenML, and using your custom
URL instead of the placeholder):`,Ce,I,Te,q,st=`You can also use the Direct URL in your browser to use the ZenML dashboard as a
fullscreen application (i.e. without the HuggingFace Spaces wrapper around it).`,ke,w,rt=`<p>The ZenML dashboard will currently not work when viewed from within the Huggingface
webpage (i.e. wrapped in the main <code>https://huggingface.co/...</code> website). This is on
account of a limitation in how cookies are handled between ZenML and Huggingface.
You <strong>must</strong> view the dashboard from the ‘Direct URL’ (see above).</p>`,He,Y,Se,j,ut=`By default the ZenML application will be configured to use a SQLite
non-persistent database. If you want to use a persistent database, you can
configure this by amending the <code>Dockerfile</code> in your Space’s root directory. For
full details on the various parameters you can change, see <a href="https://docs.zenml.io/getting-started/deploying-zenml/docker#zenml-server-configuration-options" rel="nofollow">our reference
documentation</a> on configuring
ZenML when deployed with Docker.`,_e,v,ct=`<p>If you are using the space just for testing and experimentation, you don’t need
to make any changes to the configuration. Everything will work out of the box.</p>`,Ze,A,pt=`You can also use an external secrets backend together with your HuggingFace
Spaces as described in <a href="https://docs.zenml.io/getting-started/deploying-zenml/docker#zenml-server-configuration-options" rel="nofollow">our
documentation</a>. You should be
sure to use HuggingFace’s inbuilt ‘Repository secrets’ functionality to
configure any secrets you need to use in your<code>Dockerfile</code> configuration. <a href="https://huggingface.co/docs/hub/spaces-sdks-docker#secret-management" rel="nofollow">See the
documentation</a>
for more details how to set this up.`,ze,b,ht=`<p>If you wish to use a cloud secrets backend together with ZenML for secrets
management, <strong>you must take the following minimal security precautions</strong> on your ZenML Server on the
Dashboard:</p> <ul><li>change your password on the <code>default</code> account that you get when you start. You
can do this from the Dashboard or via the CLI.</li> <li>create a new user account with a password and assign it the <code>admin</code> role. This
can also be done from the Dashboard (by ‘inviting’ a new user) or via the CLI.</li> <li>reconnect to the server using the new user account and password as described
above, and use this new user account as your working account.</li></ul> <p>This is because the default user created by the
HuggingFace Spaces deployment process has no password assigned to it and as the
Space is publicly accessible (since the Space is public) <em>potentially anyone
could access your secrets without this extra step</em>. To change your password
navigate to the Settings page by clicking the button in the upper right hand
corner of the Dashboard and then click ‘Update Password’.</p>`,Pe,N,Ue,B,ft=`The default space will use the latest version of ZenML automatically. If you
want to update your version, you can simply select the ‘Factory reboot’ option
within the ‘Settings’ tab of the space. Note that this will wipe any data
contained within the space and so if you are not using a MySQL persistent
database (as described above) you will lose any data contained within your ZenML
deployment on the space. You can also configure the space to use an earlier
version by updating the <code>Dockerfile</code>’s <code>FROM</code> import statement at the very top.`,Ee,Q,Re,V,mt=`As a next step, check out our <a href="https://docs.zenml.io/starter-guide/pipelines" rel="nofollow">Starter Guide to MLOps with
ZenML</a> which is a series of short
practical pages on how to get going quickly. Alternatively, check out <a href="https://github.com/zenml-io/zenml/tree/main/examples/quickstart" rel="nofollow">our
<code>quickstart</code>
example</a> which
is a full end-to-end example of many of the features of ZenML.`,De,W,Oe,J,dt=`If you are having trouble with your ZenML server on HuggingFace Spaces, you can
view the logs by clicking on the “Open Logs” button at the top of the space.
This will give you more context of what’s happening with your server.`,Fe,K,gt=`If you have suggestions or need specific support for anything else which isn’t
working, please <a href="https://zenml.io/slack-invite/" rel="nofollow">join the ZenML Slack community</a>
and we’ll be happy to help you out!`,Ie,X,qe,ne,Ye;return L=new Ct({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),M=new ee({props:{title:"ZenML on Spaces",local:"zenml-on-spaces",headingTag:"h1"}}),S=new ee({props:{title:"⚡️ Deploy ZenML on Spaces",local:"-deploy-zenml-on-spaces",headingTag:"h2"}}),D=new ee({props:{title:"Connecting to your ZenML Server from your Local Machine",local:"connecting-to-your-zenml-server-from-your-local-machine",headingTag:"h2"}}),I=new Tt({props:{code:"emVubWwlMjBjb25uZWN0JTIwLS11cmwlMjAnJTNDWU9VUl9IRl9TUEFDRVNfRElSRUNUX1VSTCUzRSclMjAtLXVzZXJuYW1lJTNEJ2RlZmF1bHQnJTIwLS1wYXNzd29yZCUzRCcn",highlighted:"zenml connect --url &#x27;&lt;YOUR_HF_SPACES_DIRECT_URL&gt;&#x27; --username=&#x27;default&#x27; --password=&#x27;&#x27;",wrap:!1}}),Y=new ee({props:{title:"Extra Configuration Options",local:"extra-configuration-options",headingTag:"h2"}}),N=new ee({props:{title:"Upgrading your ZenML Server on HF Spaces",local:"upgrading-your-zenml-server-on-hf-spaces",headingTag:"h2"}}),Q=new ee({props:{title:"Next Steps",local:"next-steps",headingTag:"h2"}}),W=new ee({props:{title:"🤗 Feedback and support",local:"-feedback-and-support",headingTag:"h2"}}),X=new kt({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-sdks-docker-zenml.md"}}),{c(){d=l("meta"),oe=a(),te=l("p"),ae=a(),u(L.$$.fragment),ie=a(),u(M.$$.fragment),le=a(),x=l("p"),x.innerHTML=Ae,se=a(),$=l("p"),$.textContent=Ne,re=a(),C=l("p"),C.textContent=Be,ue=a(),T=l("p"),T.innerHTML=Qe,ce=a(),k=l("p"),k.innerHTML=Ve,pe=a(),H=l("p"),H.innerHTML=We,he=a(),u(S.$$.fragment),fe=a(),_=l("p"),_.textContent=Je,me=a(),g=l("a"),g.innerHTML=Ke,de=a(),Z=l("p"),Z.textContent=Xe,ge=a(),z=l("p"),z.innerHTML=Ge,ye=a(),P=l("p"),P.textContent=et,we=a(),U=l("p"),U.innerHTML=tt,ve=a(),E=l("p"),E.textContent=nt,be=a(),R=l("p"),R.innerHTML=ot,Le=a(),u(D.$$.fragment),Me=a(),O=l("p"),O.textContent=at,xe=a(),y=l("blockquote"),y.innerHTML=it,$e=a(),F=l("p"),F.textContent=lt,Ce=a(),u(I.$$.fragment),Te=a(),q=l("p"),q.textContent=st,ke=a(),w=l("blockquote"),w.innerHTML=rt,He=a(),u(Y.$$.fragment),Se=a(),j=l("p"),j.innerHTML=ut,_e=a(),v=l("blockquote"),v.innerHTML=ct,Ze=a(),A=l("p"),A.innerHTML=pt,ze=a(),b=l("blockquote"),b.innerHTML=ht,Pe=a(),u(N.$$.fragment),Ue=a(),B=l("p"),B.innerHTML=ft,Ee=a(),u(Q.$$.fragment),Re=a(),V=l("p"),V.innerHTML=mt,De=a(),u(W.$$.fragment),Oe=a(),J=l("p"),J.textContent=dt,Fe=a(),K=l("p"),K.innerHTML=gt,Ie=a(),u(X.$$.fragment),qe=a(),ne=l("p"),this.h()},l(e){const t=xt("svelte-u9bgzb",document.head);d=s(t,"META",{name:!0,content:!0}),t.forEach(n),oe=i(e),te=s(e,"P",{}),yt(te).forEach(n),ae=i(e),c(L.$$.fragment,e),ie=i(e),c(M.$$.fragment,e),le=i(e),x=s(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-se4hh5"&&(x.innerHTML=Ae),se=i(e),$=s(e,"P",{"data-svelte-h":!0}),r($)!=="svelte-4e0nrh"&&($.textContent=Ne),re=i(e),C=s(e,"P",{"data-svelte-h":!0}),r(C)!=="svelte-6eb5e1"&&(C.textContent=Be),ue=i(e),T=s(e,"P",{"data-svelte-h":!0}),r(T)!=="svelte-v0nlhn"&&(T.innerHTML=Qe),ce=i(e),k=s(e,"P",{"data-svelte-h":!0}),r(k)!=="svelte-cr30gl"&&(k.innerHTML=Ve),pe=i(e),H=s(e,"P",{"data-svelte-h":!0}),r(H)!=="svelte-10w1dv6"&&(H.innerHTML=We),he=i(e),c(S.$$.fragment,e),fe=i(e),_=s(e,"P",{"data-svelte-h":!0}),r(_)!=="svelte-1ppvb5a"&&(_.textContent=Je),me=i(e),g=s(e,"A",{href:!0,"data-svelte-h":!0}),r(g)!=="svelte-h8yqkc"&&(g.innerHTML=Ke),de=i(e),Z=s(e,"P",{"data-svelte-h":!0}),r(Z)!=="svelte-mdxpkf"&&(Z.textContent=Xe),ge=i(e),z=s(e,"P",{"data-svelte-h":!0}),r(z)!=="svelte-1a42vw4"&&(z.innerHTML=Ge),ye=i(e),P=s(e,"P",{"data-svelte-h":!0}),r(P)!=="svelte-6fl4l6"&&(P.textContent=et),we=i(e),U=s(e,"P",{"data-svelte-h":!0}),r(U)!=="svelte-1trbth0"&&(U.innerHTML=tt),ve=i(e),E=s(e,"P",{"data-svelte-h":!0}),r(E)!=="svelte-b8aggg"&&(E.textContent=nt),be=i(e),R=s(e,"P",{"data-svelte-h":!0}),r(R)!=="svelte-3b2pb6"&&(R.innerHTML=ot),Le=i(e),c(D.$$.fragment,e),Me=i(e),O=s(e,"P",{"data-svelte-h":!0}),r(O)!=="svelte-nzvood"&&(O.textContent=at),xe=i(e),y=s(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),r(y)!=="svelte-cpi8qc"&&(y.innerHTML=it),$e=i(e),F=s(e,"P",{"data-svelte-h":!0}),r(F)!=="svelte-ds5pw1"&&(F.textContent=lt),Ce=i(e),c(I.$$.fragment,e),Te=i(e),q=s(e,"P",{"data-svelte-h":!0}),r(q)!=="svelte-pwyhtz"&&(q.textContent=st),ke=i(e),w=s(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),r(w)!=="svelte-shc262"&&(w.innerHTML=rt),He=i(e),c(Y.$$.fragment,e),Se=i(e),j=s(e,"P",{"data-svelte-h":!0}),r(j)!=="svelte-1qvsz0l"&&(j.innerHTML=ut),_e=i(e),v=s(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),r(v)!=="svelte-1t2dxt0"&&(v.innerHTML=ct),Ze=i(e),A=s(e,"P",{"data-svelte-h":!0}),r(A)!=="svelte-cas8ql"&&(A.innerHTML=pt),ze=i(e),b=s(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),r(b)!=="svelte-1k0682w"&&(b.innerHTML=ht),Pe=i(e),c(N.$$.fragment,e),Ue=i(e),B=s(e,"P",{"data-svelte-h":!0}),r(B)!=="svelte-sliug8"&&(B.innerHTML=ft),Ee=i(e),c(Q.$$.fragment,e),Re=i(e),V=s(e,"P",{"data-svelte-h":!0}),r(V)!=="svelte-nvx63g"&&(V.innerHTML=mt),De=i(e),c(W.$$.fragment,e),Oe=i(e),J=s(e,"P",{"data-svelte-h":!0}),r(J)!=="svelte-1t5cmt5"&&(J.textContent=dt),Fe=i(e),K=s(e,"P",{"data-svelte-h":!0}),r(K)!=="svelte-ysghuv"&&(K.innerHTML=gt),Ie=i(e),c(X.$$.fragment,e),qe=i(e),ne=s(e,"P",{}),yt(ne).forEach(n),this.h()},h(){G(d,"name","hf:doc:metadata"),G(d,"content",St),G(g,"href","https://huggingface.co/new-space?template=zenml/zenml-template-space"),G(y,"class","warning"),G(w,"class","warning"),G(v,"class","tip"),G(b,"class","warning")},m(e,t){$t(document.head,d),o(e,oe,t),o(e,te,t),o(e,ae,t),p(L,e,t),o(e,ie,t),p(M,e,t),o(e,le,t),o(e,x,t),o(e,se,t),o(e,$,t),o(e,re,t),o(e,C,t),o(e,ue,t),o(e,T,t),o(e,ce,t),o(e,k,t),o(e,pe,t),o(e,H,t),o(e,he,t),p(S,e,t),o(e,fe,t),o(e,_,t),o(e,me,t),o(e,g,t),o(e,de,t),o(e,Z,t),o(e,ge,t),o(e,z,t),o(e,ye,t),o(e,P,t),o(e,we,t),o(e,U,t),o(e,ve,t),o(e,E,t),o(e,be,t),o(e,R,t),o(e,Le,t),p(D,e,t),o(e,Me,t),o(e,O,t),o(e,xe,t),o(e,y,t),o(e,$e,t),o(e,F,t),o(e,Ce,t),p(I,e,t),o(e,Te,t),o(e,q,t),o(e,ke,t),o(e,w,t),o(e,He,t),p(Y,e,t),o(e,Se,t),o(e,j,t),o(e,_e,t),o(e,v,t),o(e,Ze,t),o(e,A,t),o(e,ze,t),o(e,b,t),o(e,Pe,t),p(N,e,t),o(e,Ue,t),o(e,B,t),o(e,Ee,t),p(Q,e,t),o(e,Re,t),o(e,V,t),o(e,De,t),p(W,e,t),o(e,Oe,t),o(e,J,t),o(e,Fe,t),o(e,K,t),o(e,Ie,t),p(X,e,t),o(e,qe,t),o(e,ne,t),Ye=!0},p:vt,i(e){Ye||(h(L.$$.fragment,e),h(M.$$.fragment,e),h(S.$$.fragment,e),h(D.$$.fragment,e),h(I.$$.fragment,e),h(Y.$$.fragment,e),h(N.$$.fragment,e),h(Q.$$.fragment,e),h(W.$$.fragment,e),h(X.$$.fragment,e),Ye=!0)},o(e){f(L.$$.fragment,e),f(M.$$.fragment,e),f(S.$$.fragment,e),f(D.$$.fragment,e),f(I.$$.fragment,e),f(Y.$$.fragment,e),f(N.$$.fragment,e),f(Q.$$.fragment,e),f(W.$$.fragment,e),f(X.$$.fragment,e),Ye=!1},d(e){e&&(n(oe),n(te),n(ae),n(ie),n(le),n(x),n(se),n($),n(re),n(C),n(ue),n(T),n(ce),n(k),n(pe),n(H),n(he),n(fe),n(_),n(me),n(g),n(de),n(Z),n(ge),n(z),n(ye),n(P),n(we),n(U),n(ve),n(E),n(be),n(R),n(Le),n(Me),n(O),n(xe),n(y),n($e),n(F),n(Ce),n(Te),n(q),n(ke),n(w),n(He),n(Se),n(j),n(_e),n(v),n(Ze),n(A),n(ze),n(b),n(Pe),n(Ue),n(B),n(Ee),n(Re),n(V),n(De),n(Oe),n(J),n(Fe),n(K),n(Ie),n(qe),n(ne)),n(d),m(L,e),m(M,e),m(S,e),m(D,e),m(I,e),m(Y,e),m(N,e),m(Q,e),m(W,e),m(X,e)}}}const St='{"title":"ZenML on Spaces","local":"zenml-on-spaces","sections":[{"title":"⚡️ Deploy ZenML on Spaces","local":"-deploy-zenml-on-spaces","sections":[],"depth":2},{"title":"Connecting to your ZenML Server from your Local Machine","local":"connecting-to-your-zenml-server-from-your-local-machine","sections":[],"depth":2},{"title":"Extra Configuration Options","local":"extra-configuration-options","sections":[],"depth":2},{"title":"Upgrading your ZenML Server on HF Spaces","local":"upgrading-your-zenml-server-on-hf-spaces","sections":[],"depth":2},{"title":"Next Steps","local":"next-steps","sections":[],"depth":2},{"title":"🤗 Feedback and support","local":"-feedback-and-support","sections":[],"depth":2}],"depth":1}';function _t(je){return bt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rt extends Lt{constructor(d){super(),Mt(this,d,_t,Ht,wt,{})}}export{Rt as component};
