Skip to content

Commit

Permalink
Drop support for loader.preload in manifests
Browse files Browse the repository at this point in the history
It was already long-deprecated.

Signed-off-by: Michał Kowalczyk <[email protected]>
  • Loading branch information
mkow committed Feb 24, 2022
1 parent 90da396 commit 9d7c3c5
Show file tree
Hide file tree
Showing 18 changed files with 3 additions and 72 deletions.
2 changes: 0 additions & 2 deletions CI-Examples/bash/manifest.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# This is a general manifest template for running Bash and core utility programs,
# including ls, cat, cp, date, and rm.

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "{{ execdir }}/bash"

Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/blender/blender.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Blender manifest example

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "/blender/blender"

Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/busybox/busybox.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Busybox manifest file example

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "busybox"

Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/helloworld/helloworld.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Hello World manifest file example

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "helloworld"
loader.log_level = "{{ log_level }}"
Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/lighttpd/lighttpd.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# lighttpd manifest example

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "{{ install_dir }}/sbin/lighttpd"

Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/memcached/memcached.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Memcached manifest file example

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "memcached"

Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/nginx/nginx.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Nginx manifest example

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "{{ install_dir }}/sbin/nginx"

Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/python/python.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Python3 manifest example

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "{{ entrypoint }}"

Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/ra-tls-mbedtls/client.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Client manifest file (both for EPID and DCAP)

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "client"

Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/ra-tls-mbedtls/server.manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# RA-TLS manifest file example

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "server"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Secret Provisioning manifest file example (client)

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "secret_prov_client"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Secret Provisioning manifest file example (minimal client)

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "secret_prov_min_client"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Secret Provisioning manifest file example (Protected Files client)

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "secret_prov_pf_client"

Expand Down
4 changes: 0 additions & 4 deletions CI-Examples/redis/redis-server.manifest.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

################################## GRAMINE ####################################

# Deprecated option, only for compatibility with Gramine v1.0. For newer
# versions of Gramine, use `loader.entrypoint` instead.
loader.preload = "file:{{ gramine.libos }}"

# PAL entrypoint (points to the LibOS layer library of Gramine). There is
# currently only one implementation, so it is always set to libsysdb.so.
loader.entrypoint = "file:{{ gramine.libos }}"
Expand Down
2 changes: 0 additions & 2 deletions CI-Examples/sqlite/manifest.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This is a general manifest template for running SQLite.

loader.preload = "file:{{ gramine.libos }}" # for compatibility with v1.0

loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "{{ execdir }}/sqlite3"

Expand Down
13 changes: 0 additions & 13 deletions Documentation/manifest-syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -858,19 +858,6 @@ Linux scheduler: the effective maximum is 250 samples per second.
Deprecated options
------------------

Preloaded library (deprecated option)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

loader.preload = "[URI]"

This syntax specifies the library to be preloaded before loading the executable.
This usually points to the LibOS library ``libsysdb.so``.

Note that previously this syntax allowed to specify the list of URIs (separated
by commas). This ability was never used and therefore was removed completely.

FS mount points (deprecated syntax)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
9 changes: 0 additions & 9 deletions Pal/src/db_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,15 +509,6 @@ noreturn void pal_main(uint64_t instance_id, /* current instance id */
if (ret < 0)
INIT_FAIL_MANIFEST(PAL_ERROR_INVAL, "Cannot parse 'loader.entrypoint'");

if (!entrypoint_name) {
ret = toml_string_in(g_pal_public_state.manifest_root, "loader.preload", &entrypoint_name);
if (ret < 0)
INIT_FAIL_MANIFEST(PAL_ERROR_INVAL, "Cannot parse 'loader.preload'");

if (entrypoint_name)
log_warning("'loader.preload' is deprecated; please switch to 'loader.entrypoint'");
}

if (!entrypoint_name)
INIT_FAIL(PAL_ERROR_INVAL, "No 'loader.entrypoint' is specified in the manifest");

Expand Down
21 changes: 3 additions & 18 deletions python/graminelibos/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ def __init__(self, manifest_str):
sgx.setdefault('nonpie_binary', False)
sgx.setdefault('enable_stats', False)

# NOTE: `loader.preload` is deprecated; remove the below in the future
loader = manifest.setdefault('loader', {})
loader.setdefault('preload', '')

if not isinstance(sgx['trusted_files'], list):
raise ValueError("Unsupported trusted files syntax, more info: " +
"https://gramine.readthedocs.io/en/latest/manifest-syntax.html#trusted-files")
Expand Down Expand Up @@ -161,9 +157,8 @@ def dump(self, f):
def expand_all_trusted_files(self):
"""Expand all trusted files entries.
Collects all trusted files entries and the file from ``loader.preload`` entry, hashes each
of them (skipping these which already had a hash present) and updates ``sgx.trusted_files``
manifest entry with the result.
Collects all trusted files entries, hashes each of them (skipping these which already had a
hash present) and updates ``sgx.trusted_files`` manifest entry with the result.
Returns a list of all expanded files, i.e. files that we need to hash, and directories that
we needed to list.
Expand All @@ -178,19 +173,14 @@ def expand_all_trusted_files(self):
for tf in self['sgx']['trusted_files']:
append_trusted_dir_or_file(trusted_files, tf, expanded)

# NOTE: `loader.preload` is deprecated; remove the below in the future
preload_str = self['loader']['preload']
if preload_str and not any(preload_str == tf['uri'] for tf in trusted_files):
append_trusted_dir_or_file(trusted_files, preload_str, expanded)

self['sgx']['trusted_files'] = trusted_files
return expanded

def get_dependencies(self):
"""Generate list of files which this manifest depends on.
Collects all trusted files that are not yet expanded (do not have a hash in the entry) and
all files from ``loader.preload`` entry and returns them.
returns them.
Returns:
list(pathlib.Path): List of paths to the files this manifest depends on.
Expand All @@ -200,11 +190,6 @@ def get_dependencies(self):
"""
deps = set()

# NOTE: `loader.preload` is deprecated; remove the below in the future
preload_str = self['loader']['preload']
if preload_str:
deps.add(uri2path(preload_str))

for tf in self['sgx']['trusted_files']:
if not tf.get('sha256'):
deps.add(uri2path(tf['uri']))
Expand Down

0 comments on commit 9d7c3c5

Please sign in to comment.