Streamlit 앱 배포하기¶
snow streamlit deploy 명령은 선택한 데이터베이스와 스키마 내에 새로운 Streamlit 오브젝트를 생성합니다. 기본적으로 이 명령은 현재 작업 디렉터리에서 이름이 streamlit_app.py 인 기본 파일을 찾습니다.
전제 조건¶
Streamlit 앱을 Snowflake CLI 와 함께 배포하기 전에 다음 필수 구성 요소를 충족해야 합니다
디렉터리 구조가 올바른 로컬 Streamlit 앱이 있는지 확인하고
snowflake.yml프로젝트 정의 파일이 있어야 합니다.Ensure that your account has the correct privileges as described in Streamlit 앱 생성 및 사용에 필요한 권한.
Streamlit 앱 파일을 업로드할 수 있는 명명된 스테이지를 생성하거나 이 스테이지에 액세스할 수 있는지 확인하십시오.
Streamlit 앱을 배포하는 방법¶
참고
Snowflake CLI 3.14.0 릴리스가 출시됨에 따라 snow streamlit deploy 명령은 이제 사용 중단된 구문(ROOT_LOCATION = ‘<stage_path_and_root_directory>’) 대신 업데이트된 CREATE STREAMLIT구문(FROM source_location)을 사용합니다. 더 이상 사용되지 않는 구문을 계속 사용하려면 --legacy 옵션을 사용하면 됩니다.
snow streamlit deploy 명령은 로컬 파일을 스테이지에 업로드하고 선택한 데이터베이스와 스키마 내에 새 Streamlit 오브젝트를 생성합니다. 프로젝트 정의 파일 에는 기본 Python 파일과 쿼리 웨어하우스가 지정되어야 합니다. 다음 옵션을 지정할 수도 있습니다.
--replace: 지정된 Streamlit 앱이 이미 있는 경우 이를 대체합니다.--open: 앱을 배포한 후 기본 브라우저에서 Streamlit 앱을 엽니다.--prune: 스테이지에 존재하지만 로컬 파일 시스템에 있는 파일이 아닌 파일을 제거합니다(기본적으로 제거되는 파일은 없음).--legacy: 사용 중단된 SQLsyntax(ROOT_LOCATION = ‘<stage_path_and_root_directory>’)를 사용합니다.
By default the command automatically deploys the environment.yml file and the content of the pages/
directory, if any of those exists. You can use different files by using command-line options.
Streamlit 앱을 만드는 방법에 대한 자세한 내용은 CLI snow streamlit deploy 및 SQL CREATE STREAMLIT 명령을 참조하십시오.