日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

redis生产环境持久化_在SageMaker上安装持久性Julia环境

發布時間:2023/12/15 编程问答 48 豆豆
生活随笔 收集整理的這篇文章主要介紹了 redis生产环境持久化_在SageMaker上安装持久性Julia环境 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

redis生產環境持久化

SageMaker is a great environment for data scientists to explore new languages and methods without having to worry too much about the underlying infrastructure. As long as you don’t need to customize the existing environments, everything looks great and just works. However, as soon as you want to venture off the beaten path you will run into some unexpected challenges.

SageMaker為數據科學家提供了一個探索新語言和新方法的絕佳環境,而無需過多地擔心基礎架構。 只要您不需要自定義現有的環境,一切看起來就很好并且可以正常工作。 但是,一旦您想走人跡罕至的道路,就會遇到一些意想不到的挑戰。

Our data scientists are generally cost conscious and happily stop their SageMaker instances when they are not using them. Unfortunately, SageMaker doesn’t persist any data written outside of the ~/SageMaker directory. This means that changes to the Anaconda environments don’t persist across restarts of the notebook. This is very frustrating. To fix this we need to create a persistent Anaconda environment in the ~/SageMaker folder and tell Julia to place its packages there as well. Let’s get started!

我們的數據科學家通常精打細算,并且在不使用SageMaker實例時會高興地停止它們。 不幸的是,SageMaker不會保留~/SageMaker目錄之外寫入的任何數據。 這意味著對Anaconda環境的更改不會在筆記本計算機重新啟動后持續存在。 這非常令人沮喪。 為了解決這個問題,我們需要在~/SageMaker文件夾中創建一個持久的Anaconda環境,并告訴Julia也將其軟件包放置在此處。 讓我們開始吧!

Log on to your SageMaker environment and open a new Terminal session. Let’s create a new, empty Anaconda environment, located in the ~/SageMaker directory.

登錄到您的SageMaker環境并打開一個新的終端會話。 讓我們在~/SageMaker目錄中創建一個新的空Anaconda環境。

conda create --yes --prefix ~/SageMaker/envs/julia

Download and extract the latest version of Julia

下載并提取最新版本的Julia

curl --silent https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.0-linux-x86_64.tar.gz | tar xzf -
cp -R julia-1.5.0/* ~/SageMaker/envs/julia/

Before we start installing packages for Julia we need to make sure that Julia is loading its packages from the right directory. This also ensures that packages you install via a notebook or from the Terminal will also be stored in the persistent space of the SageMaker instance.

在開始為Julia安裝軟件包之前,我們需要確保Julia從正確的目錄加載其軟件包。 這還可以確保您通過筆記本電腦或從終端安裝的軟件包也將存儲在SageMaker實例的永久空間中。

mkdir -p ~/SageMaker/envs/julia/etc/conda/activate.decho 'export JULIA_DEPOT_PATH=~/SageMaker/envs/julia/depot' >> ~/SageMaker/envs/julia/etc/conda/activate.d/env.shecho -e 'empty!(DEPOT_PATH)\npush!(DEPOT_PATH,raw"/home/ec2-user/SageMaker/envs/julia/depot")' >> ~/SageMaker/envs/julia/etc/julia/startup.jl

We can now activate the environment and start installing our dependencies including IJulia. Launch the Julia REPL, install and activate IJulia.

現在,我們可以激活環境并開始安裝我們的依賴項,包括IJulia。 啟動Julia REPL,安裝并激活IJulia。

juliausing Pkg
Pkg.add("IJulia")
using IJulia

Exit the REPL (Ctrl + D) and open Jupyter or JupyterLabs. The new Julia 1.5.0 Kernel should now be visible and you are all set.

退出REPL(Ctrl + D)并打開Jupyter或JupyterLabs。 現在應該可以看到新的Julia 1.5.0內核,并且一切就緒。

After restarting the SageMaker instance you will notice that the Julia kernel has vanished. To restore the kernel, simply execute

重新啟動SageMaker實例后,您會注意到Julia內核已消失。 要還原內核,只需執行

conda run --prefix ~/SageMaker/envs/julia/ julia --eval 'using IJulia; IJulia.installkernel("Julia")'

You can get fancy and register this script as a Notebook Lifecycle Configuration which is executed automatically whenever the SageMaker instance is launched. You can find more details on how to set that up at https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html.

您可以將這個腳本注冊為Notebook Lifecycle Configuration,并在啟動SageMaker實例時自動執行。 您可以在https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html上找到有關如何進行設置的更多詳細信息。

翻譯自: https://towardsdatascience.com/installing-a-persistent-julia-environment-on-sagemaker-c67acdde9d4b

redis生產環境持久化

總結

以上是生活随笔為你收集整理的redis生产环境持久化_在SageMaker上安装持久性Julia环境的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。