gcp iot 使用_使用计算引擎将dockerized streamlit应用程序部署到gcp

gcp iot 使用

Building prototypes with the Streamlit framework is simple, at least to get things running on your own computer. Sharing with a broader audience is more complicated.

使用Streamlit框架构建原型很简单,至少可以使事情在您自己的计算机上运行。 与更多的受众共享更加复杂。

Streamlit gives us the ability to create clean apps with minimal effort and no cost. The app we use here is very simple, as this article will focus on deployment. We are going to deploy a Streamlit app to Google cloud platform compute instance following the steps laid out in this article.

Streamlit使我们能够以最小的工作量和免费的成本创建干净的应用程序。 我们在这里使用的应用程序非常简单,因为本文将重点介绍部署。 我们将按照本文列出的步骤,将Streamlit应用程序部署到Google云平台计算实例。

Here is a link to the GitHub repository with our code for the project. Note that we use Pipenv to manage our dependencies.

这是带有我们项目代码的GitHub存储库的链接。 请注意,我们使用Pipenv来管理我们的依赖项。

什么是Streamlit? (What is Streamlit?)

Streamlit is a free and open-source app framework that presents an easy way for data scientists and machine learning engineers to create great Python apps quickly. Streamlit’s opinioned nature makes building frontends easy. Lastly, Streamlit can make experimentation and production of data apps and machine learning analysis easier to do and to iterate on.

Streamlit是一个免费的开源应用程序框架 呈现一个 数据科学家和机器学习工程师快速创建出色的Python应用程序的简便方法。 Streamlit自以为是的性质使构建前端变得容易。 最后,Streamlit可以使数据应用程序的实验和生产以及机器学习分析更容易进行和迭代。

Check out their work on GitHub.

查看他们在GitHub上的工作。

Docker和我们的Dockerfile (Docker and Our Dockerfile)

Docker is the best way to put apps into production. Docker uses a Dockerfile to build a container. The built container is stored in Google Container Registry, where it can be deployed. Docker containers can be built locally and will run on any system running Docker.

Docker是将应用程序投入生产的最佳方式。 Docker使用Dockerfile来构建容器。 生成的容器存储在Google容器注册表中,可以在其中进行部署。 Docker容器可以在本地构建,并且可以在运行Docker的任何系统上运行

Here is the Dockerfile we used for this project:

这是我们用于该项目的Dockerfile:

FROM python:3.7-slim
COPY requirements.txt ./requirements.txt
RUN pip install -r requirements.txt
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./
CMD streamlit run app/app.py --server.port $PORT

The first line of our Dockerfile begins with FROM. This is where we import our OS or programming language.

Dockerfile的第一行以FROM.开头FROM. 这是我们导入操作系统或编程语言的地方。

The next two lines involve sett

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值