네이티브 애플리케이션 프레임워크의 선언적 공유에서 사용되는 애플리케이션 패키지¶
As a provider, you create an application package to bundle your data content and notebooks into a Declarative Native App. This topic explains what an app package is and describes the high-level steps to create one, from creating the initial package to adding your manifest and notebook files.
The application package and the live version¶
The app package is a container for all the files that make up the app, including the manifest file and any Snowflake Notebooks. When you create an app package, a live (staged) version of the app package is also created. The live version is a development workspace where you can add or update files, such as the manifest file and notebook files, and preview and test the experience before publishing.
Once you’re satisfied with the live version of the app, you can commit the live version to create a new immutable version of the app package, that you can then publish.
Using the live version for development simplifies version management by maintaining a single immutable version of the app package that is ready to be published, and a single live version for development. The Snowflake Native App Framework automatically manages the versioning of the app package, so you don’t need to manually track version numbers.
The Snowflake Native App Framework maintains a live version for any app package automatically. Even if you remove the live version, a new live version is created automatically from the last committed version of the app package.
애플리케이션 패키지 만들기¶
Providers develop and test an application (app) package. An app package includes files necessary to share the data in the app, and defines how data can be accessed by consumers.
이 과정에는 다음 단계가 포함됩니다.
Create an app package project (first time only): creates an app package project that will later be published. This also creates the live version of the app package.
Add content to the app package:
Create or update a manifest file: This file describes the app package and its contents.
Download notebook files. If notebooks are to be included, download a copy to be included in the app package.
Add the files to the live version of the app package.
Build the app package: allows you to verify that the manifest file is valid and that all links in the manifest file are correct.
Test the app. Install the app and try it out. Make changes, and rebuild.
Commit the app package: creates a new immutable version of the app that can be published.
Release the app package. With a released package, you can create a new listing, either privately or publicly on the Snowflake Marketplace.
이 프로세스는 :doc:`tutorials/getting-started`에 설명되어 있습니다. 이 섹션에는 다양한 스테이징 단계에서 사용할 수 있는 옵션에 대한 추가 세부 정보가 포함되어 있습니다.
새 애플리케이션 패키지 만들기¶
First, create a new Declarative Native App package to hold the app’s files, either via Snowsight or SQL commands from Snowflake CLI, using the snow://package/<DECL_SHARE_APP_PKG>/versions/LIVE/ URL scheme.
Snowsight 를 사용하여 새 앱 패키지를 생성하려면 다음을 수행합니다.
:doc:`Snowflake CLI</developer-guide/snowflake-cli/index>`에서 SQL을 사용하여 새 앱 패키지를 생성하려면 다음을 수행합니다.
Create a Declarative Native App package using the CREATE APPLICATION PACKAGE … TYPE=DATA command, replacing
<DECL_SHARE_APP_PKG>with the name you want to give the app package:
snow sql -q "CREATE APPLICATION PACKAGE <DECL_SHARE_APP_PKG> TYPE = DATA;"
The new empty app package is created. This also creates a live version of the app package that you can edit.
Assemble content for the application package¶
An app package includes the following components:
A manifest file (required): A text-based file that defines the app’s structure.
Snowflake Notebook files (optional): One or more text-based files that can act as a front end to the consumer experience, referencing the shared views and tables. They can also include code, reference visualizations, and include logic to help present the data.
매니페스트 파일 만들기 또는 업데이트하기¶
You can create or update a manifest file, which describes the app package and its shared content–for example, notebooks, tables, and views. It defines other metadata, such as app roles included with the app.
The manifest file must be named manifest.yml, and must be added to the root level of the app package.
자세한 내용은 Declarative Native App 매니페스트 참조 섹션을 참조하십시오. 연결된 :doc:`tutorials/getting-started`에는 예제 매니페스트 파일이 포함되어 있습니다.
노트북 파일 가져오기¶
If Snowflake Notebooks are to be included in the app, download a copy of each notebook file so you can include it in the app package.
Snowsight 에서 다음을 수행합니다.
탐색 메뉴에서 Projects » :ui:`Notebooks`를 선택한 후 다운로드할 노트북을 선택합니다.
In the left pane, next to your notebook, select … » Download.
파일은 로컬 컴퓨터에 <notebook_name>.ipynb 파일로 다운로드됩니다.
참고
노트북 환경에는 Python 및 Streamlit을 포함하여 Anaconda 패키지 세트가 사전 설치되어 있습니다. 노트북에서 추가 Anaconda 패키지를 사용하는 경우 컨슈머의 환경에서 사용할 수 있도록 해당 패키지를 노트북 에 패키지로 추가해야 합니다. 노트북에 Anaconda 패키지를 추가하는 방법에 대한 자세한 내용은 Add Anaconda packages to a notebook 섹션을 참조하세요.
Add files to the live version¶
Add the manifest and notebook files to the live version of the app package:
Snowsight 를 사용하여 앱 패키지를 채우려면 다음을 수행합니다.
If you’re not already viewing the app package’s listing, from the navigation menu, select Projects » App Packages, and then select the app package you want to add files to.
Upload files 을 선택합니다. (추가 파일을 바꾸거나 추가하는 경우 :ui:`Manage files`를 선택한 후 :ui:`Upload files`를 선택합니다.)
노트북 파일과 매니페스트를 하드 디스크에서 Upload files 대화 상자(표시된 경우)로 드래그하거나 :ui:`Browse`를 선택하여 파일을 찾아 선택합니다.
:ui:`Upload`를 선택하여 파일을 라이브 스테이지에 업로드하고 빌드를 트리거합니다.
Snowflake CLI에서 SQL을 사용하여 앱 패키지를 채우려면 파일 경로를 자신의 경로로 대체하고 `<DECL_SHARE_APP_PKG>`를 앱 패키지 이름으로 대체합니다.
매니페스트 파일:
snow sql -q "PUT file:////Users/test_user/Documents/manifest.yml snow://package/<DECL_SHARE_APP_PKG>/versions/LIVE/ OVERWRITE=TRUE AUTO_COMPRESS=false;"
Notebook file:
snow sql -q "PUT file:////Users/test_user/Documents/NOTEBOOK.ipynb snow://package/<DECL_SHARE_APP_PKG>/versions/LIVE/ OVERWRITE=TRUE AUTO_COMPRESS=false;"
Verify the files are in the application package with the following command:
snow sql -q "LIST snow://package/<DECL_SHARE_APP_PKG>/versions/LIVE"
출력에는 다음과 유사한 앱 패키지의 라이브 버전에 있는 파일이 표시됩니다.
+--------------------------------------------------------------------------------+ | name | size | md5 | last_modified | |-------------------------------+------+---------+-------------------------------| | /versions/live/manifest.yml | 304 | 843a... | Wed, 23 Jul 2025 08:27:26 GMT | | /versions/live/NOTEBOOK.ipynb | 832 | b014... | Wed, 23 Jul 2025 04:32:22 GMT | +--------------------------------------------------------------------------------+
Download a file from the application package¶
Snowflake CLI에서 GET SQL 명령을 사용하여 앱 패키지에서 파일을 다운로드할 수 있습니다.
now sql -q "GET snow://package/<package_name>/versions/LIVE/manifest.yml file://manifest.yml"
Remove content from the application package¶
You can remove files from the application package.
Using Snowsight:
If you’re not already viewing the app package’s listing, from the navigation menu, select Projects » App Packages, and then select the app package you want to remove files from.
Manage files » Remove files 를 선택합니다.
제거할 파일을 선택한 후 :ui:`Delete`를 선택합니다.
Remove files 대화 상자에서 제거할 파일을 선택한 후 :ui:`Remove & build`를 선택합니다.
Snowflake CLI에서 REMOVE(또는 RM) SQL 명령을 사용합니다.
snow sql -q "RM snow://package/<DECL_SHARE_APP_PKG>/versions/LIVE/manifest.yml"
애플리케이션 패키지 빌드하기¶
다음으로, 앱의 테스트 가능한 버전을 빌드합니다.
In Snowsight:
전체 파일 세트를 앱 패키지에 업로드하면 빌드가 자동으로 시작됩니다.
다른 시간에 빌드를 수행하려면 앱 패키지의 페이지에서 빌드 버튼을 선택합니다.
If there are any errors in the manifest file, the build fails and gives information on how to fix the error. Correct the errors and rebuild the app package.
ALTER APPLICATION PACKAGE … BUILD 명령은 앱 패키지의 테스트 가능한 버전을 빌드하고 매니페스트 파일이 유효하며 모든 링크가 작동하는지 확인합니다.
ALTER APPLICATION PACKAGE <DECL_SHARE_APP_PKG> BUILD;
If there are any errors in the manifest file, the build fails and gives information on how to fix the error. Correct those errors and rebuild the app package.
빌드된 앱은 라이브 상태로 유지되며 애플리케이션 패키지를 계속 변경할 수 있습니다.
건너뛰기!¶
For updates that don’t require further testing, you can skip ahead by building, committing, and releasing an app package all at once using the ALTER APPLICATION PACKAGE … RELEASE LIVE VERSION command.
ALTER APPLICATION PACKAGE <DECL_SHARE_APP_PKG> RELEASE LIVE VERSION;
애플리케이션 테스트하기¶
After building the app package, you can perform basic tests on it from the live environment.
Install the app from an app package using the command: CREATE APPLICATION … FROM APPLICATION PACKAGE, replacing <DECL_SHARE_APP> with the name of the app. For example:
CREATE APPLICATION <DECL_SHARE_APP> FROM APPLICATION PACKAGE <DECL_SHARE_APP_PKG>
Update the files in the app package as needed, and then see if it worked by using the command: ALTER APPLICATION PACKAGE … UPGRADE USING VERSION LIVE.
ALTER APPLICATION PACKAGE <DECL_SHARE_APP_PKG> UPGRADE USING VERSION LIVE;
To test some features, such as app roles, you must first release a new version of the app package, and then test using a separate consumer account. For more information, see Declarative Native App 설치하기 and Declarative Native App 의 콘텐츠에 액세스하기.
선택 사항: 라이브 버전에서 편집 재설정하기¶
If the edits made to the live version of the app package are no longer needed, you can reset the app package to the state before the edits were made with the ALTER APPLICATION PACKAGE … ABORT LIVE VERSION command.
ALTER APPLICATION PACKAGE <DECL_SHARE_APP_PKG> ABORT LIVE VERSION;
When you use the preceding command to remove the current live version, a new live version is created with the same contents as the last committed version of the app package. The live version is reset to the last committed version, and all changes made to the live version are discarded.
Commit and release the application package¶
Committing the app package builds a new immutable version of the app that can’t be edited and is ready to be published. Releasing the app package does the following:
커밋된 앱을 컨슈머와 공유하도록 준비합니다.
공급자가 이미 앱을 컨슈머와 공유한 경우 해당 컨슈머는 새 버전을 자동으로 사용할 수 있습니다.
If there’s already a live version of the app on the Snowflake Marketplace, the new version is automatically available to consumers who have installed the app.
Snowsight 를 사용하여 앱 패키지를 커밋하고 릴리스하려면 다음을 수행합니다.
If you’re not already viewing the app package’s listing, from the navigation menu, select Projects » App Packages, and then select the app package you want to release.
Commit & release 을 선택합니다.
확인 대화 상자에서 Acknowledge & continue 를 선택합니다.
The committed app package is released, and the live version of the app package is removed. A new live version of the app package is created from the new committed version for further development.
앱 패키지를 커밋하고 릴리스하면 Latest release 탭에 마지막 빌드의 내용과 동일한 릴리스의 내용이 표시됩니다.
In SQL, use the ALTER APPLICATION PACKAGE commands as shown:
ALTER APPLICATION PACKAGE <DECL_SHARE_APP_PKG> COMMIT;
The live version of the app package is removed. A new live version of the app package is created from the new committed version for further development.
Next, release the committed app package:
ALTER APPLICATION PACKAGE <DECL_SHARE_APP_PKG> RELEASE;
You can also build, commit, and release a live version of the app package, all at once:
ALTER APPLICATION PACKAGE <DECL_SHARE_APP_PKG> RELEASE LIVE VERSION;
After you release the app package, you can create a new listing for the app, either privately or publicly on the Snowflake Marketplace. For more information, see 선언적 공유를 사용하여 목록 만들기.