简体   繁体   English

如何在Amazon EC2 Web服务上运行python代码?

[英]how to run python code on amazon ec2 webservice?

I have never used amazon web services so I apologize for the naive question. 我从未使用过亚马逊网络服务,因此为这个幼稚的问题表示歉意。 I am looking to run my code on a cluster as the quad-core architecture on my local machine doesn't seem to be doing the job. 我希望在集群上运行我的代码,因为本地计算机上的四核体系结构似乎无法完成任务。 The documentation seems overwhelming and I don't even know which AWS services are going to be used for running my script on EC2. 该文档似乎不胜枚举,我什至不知道将使用哪些AWS服务在EC2上运行我的脚本。 Would I have to use their storage facility (S3) because I guess if I have to run my script, I'm going to have to store it on the cloud in a place where the cluster instance has access to the files or do I upload my files somewhere else while working with EC2? 我是否必须使用他们的存储工具(S3),因为我猜是否必须运行脚本,所以我将不得不将其存储在群集实例可以访问文件或上传的位置的云中使用EC2时我的文件在其他地方吗? If this is true is it possible for me to upload my entire directory which has all the contents of the files required by my application onto s3. 如果这是真的,那么我可以将我的应用程序所需文件的所有内容上载到我的整个目录上s3。 Any guidance would be much appreciated. 任何指导将不胜感激。 So I guess my question is do I have to use S3 to store my code in a place accessible by the cluster? 所以我想我的问题是我是否必须使用S3将代码存储在群集可访问的位置? If so is there an easy way to do it? 如果是这样,有没有一种简单的方法? Meaning I have only seen examples of creating buckets wherein one file can be transferred per bucket. 这意味着我仅看到创建存储区的示例,其中每个存储区可以传输一个文件。 Can you transfer an entire folder into a bucket? 您可以将整个文件夹转移到存储桶中吗?

If we don't require to use S3 then which other service should I use to give the cluster access to my scripts to be executed? 如果我们不需要使用S3,那么我应该使用哪个其他服务来使集群可以访问要执行的脚本?

Thanks in advance! 提前致谢!

You do not need to use S3, you would likely want to use EBS for storing the code if you need it to be preserved between instance launches. 您不需要使用S3,如果需要在实例启动之间保留代码,则可能需要使用EBS来存储代码。 When you launch an instance you have the option to add an ebs storage volume to the drive. 启动实例时,可以选择将ebs存储卷添加到驱动器。 That drive will automatically be mounted to the instance and you can access it just like you would on any physical machine. 该驱动器将自动安装到实例,您可以像在任何物理计算机上一样访问它。 ssh your code up to the amazon machine and fire away. 将您的代码上传到亚马逊机器上,然后开火。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM