This section explains how to use the Sentinel VoLTE SDK in offline mode |
What is offline mode?
Offline mode is a way to use the SDK without any internet access. It allows the SDK user to download necessary artifacts from OpenCloud’s online repository and push them into the user’s own local repository. The term 'local repository' is used to refer to a repository in the SDK user’s filesystem.
This document covers all of the steps required to create a local repository so that no internet connection is required. This can be useful for production environments or even in developer environments where internet access is limited or not available.
What is online mode?
When the SDK is not in offline mode, it is in online mode. In online mode, the SDK will connect to OpenCloud’s online repository to fetch required OpenCloud artifacts, rather than fetching from a local repository on the local machine.
The go-offline
script
The go-offline
script will create an offline repository and copy all artifacts to it. Note that this can take half an hour or more depending on connection speed.
The repository created by this script will be placed in the repositories
directory in the root of the SDK.
Run the go-offline
script:
testuser@machine$ build/bin/go-offline
$ ./build/bin/go-offline Buildfile: /home/testuser/sentinel-volte-sdkbuild.xml init-build-extensions: pre-init-ivy-common: init-ivy-common: Determining Ivy settings. Checking ivy-defaults.properties for ivy settings. artifactory.host=repo.opencloud.com (from ivy-defaults.properties) artifactory.url=https://${artifactory.host}/artifactory (from ivy-defaults.properties) ivy.cache.root=${sdk.root}/build/target/ivy-caches/online-resolvers.cache(from ivy-defaults.properties) ivy.checksums=sha1 (from ivy-defaults.properties) ivy.dir=${basedir} (from ivy-defaults.properties) ivy.libs=${target}/libs (from ivy-defaults.properties) ivy.local.root=${ivy.default.ivy.user.dir}/opencloud-local (from ivy-defaults.properties) ivy.offline.root=${sdk.root}/repositories/opencloud-offline-mirror(from ivy-defaults.properties) ivy.publication.root=${ivy.local.root} (from ivy-defaults.properties) ivy.resolve.refresh=false (from ivy-defaults.properties) ivy.sdk-resolvers.file=resolvers-remote.xml (from ivy-defaults.properties) ivy.sdk-resolvers.file.internal=resolvers-remote.xml(from ivy-defaults.properties) ivy.sdk-resolvers.path=${ivy.settings.dir}/${ivy.sdk-resolvers.file}(from ivy-defaults.properties) ivy.symlinks=false (from ivy-defaults.properties) artifactory.host=repo.opencloud.com (from ant environment) artifactory.password=******************************** (from ant environment) artifactory.url=https://repo.opencloud.com/artifactory (from ant environment) artifactory.username=testuser (from ant environment) ivy.symlinks=true (from ant environment) Writing Ivy configuration to: /home/testuser/sentinel-volte-sdkivy.properties [echo] Ivy Resolvers: /home/testuser/sentinel-volte-sdkbuild/ivy/resolvers-remote.xml [echo] Configuring Ivy with settings: /home/testuser/sentinel-volte-sdkbuild/ivy/ivysettings.xml [ivy:var] :: Apache Ivy 2.3.0 - 20130110142753 :: http://ant.apache.org/ivy/ :: [ivy:var] :: loading settings :: file = /home/testuser/sentinel-volte-sdkbuild/ivy/ivysettings.xml ivy-authentication-check: [ivy:resolve] :: loading settings :: file = /home/testuser/sentinel-volte-sdkbuild/ivy/ivysettings.xml [echo] Build infrastructure lib/ directory is missing or out of date. [echo] Populating lib/ from ivy... [mkdir] Created dir: /home/testuser/sentinel-volte-sdkbuild/target/lib [touch] Creating /home/testuser/sentinel-volte-sdkbuild/target/lib/.lib.uptodate update-index-properties: [oc:index-properties] Resolving: opencloud#volte-sentinel-index#volte/2.7.0;latest.integration [oc:index-properties] Copying /home/testuser/sentinel-volte-sdkbuild/target/ivy-caches/online-resolvers.cache/opencloud/volte-sentinel-index/volte/2.7.0/jsons/sentinel-volte-index-2.7.0.0.json to /home/testuser/sentinel-volte-sdkbuild/target/lib/index/sentinel-volte-index-2.7.0.0.json [oc:index-properties] Reading Module metadata from index: /home/testuser/sentinel-volte-sdkbuild/target/lib/index/sentinel-volte-index-2.7.0.0.json [oc:index-properties] Writing dependency properties to: /home/testuser/sentinel-volte-sdkrelease.properties init: init-branch: BUILD SUCCESSFUL Total time: 23 seconds :: loading settings :: file = /home/testuser/sentinel-volte-sdkbuild/ivy/ivysettings.xml This SDK is configured against internal OpenCloud resolvers: resolvers-remote.xml Mirroring OpenCloud dependencies to repositories/opencloud-offline-mirror Copying SDK index to offline repository... Copying SDK infrastructure dependencies to offline repository... Copying modules to offline repository... Installing module 715/715 Finished copying repository artifacts. Updating 'ivy.properties' to use offline resolvers: ivy.sdk-resolvers.file=offline-resolvers.xml ivy.cache.root=${sdk.root}/build/target/ivy-caches/offline-resolvers.cache Configuration complete. SDK is now in 'offline' mode. Use 'go-online' to return to online mode.
The script will also have switched the SDK to offline mode now, so the next time the user starts the sdkadm tool it will use the new local repository.
After switching the SDK to offline mode, it is recommended to exit the sdkadm program before further use. Just type 'quit' and press enter.
The go-online
script
The go-online
script will switch the SDK to online mode.
Run the go-online
script:
testuser@machine$ build/bin/go-online
$ ./build/bin/go-online :: loading settings :: file = /home/testuser/sentinel-volte-sdkbuild/ivy/ivysettings.xml downloading /home/testuser/sentinel-volte-sdkrepositories/opencloud-offline-mirror/opencloud/volte/2.7.0/volte-sentinel-index/2.7.0.0/sentinel-volte-index-2.7.0.0.json ... ................. (1020kB) .. (0kB) [SUCCESSFUL ] opencloud#volte-sentinel-index#volte/2.7.0;2.7.0.0!sentinel-volte-index.json (60ms) Updating 'ivy.properties' to use online resolvers: ivy.sdk-resolvers.file=resolvers-remote.xml ivy.cache.root=${sdk.root}/build/target/ivy-caches/online-resolvers.cache Configuration complete. SDK is now in 'online' mode. Use 'go-offline' to return to offline mode.
The script will also have switched the SDK to online mode now, so the next time the user starts the sdkadm tool it will use OpenCloud’s online repository.
After switching the SDK to online mode, it is recommended to exit the sdkadm program before further use. Just type 'quit' and press enter.