Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can the repository/client support multiple target plaforms? #79

Open
Slarag opened this issue Sep 19, 2023 · 1 comment
Open

Can the repository/client support multiple target plaforms? #79

Slarag opened this issue Sep 19, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request question This is a request for clarification

Comments

@Slarag
Copy link

Slarag commented Sep 19, 2023

I have an app which is bundeled using PyInstaller. The bundle is created for multiple target platforms (Windows, Linux, x86 64bit, arm v7, etc.) each. This means I'm having platform-specific bundles for each version.

Is it possible to serve those platform-specific bundles in one repository?
If yes, how does the client know which bundle it should download and use?
If not, what do you think would be a good approach? Serve seperate repositories for each target platform? For example in settings.py:

import os
import platform

prefix = ''
if os.name == 'nt':
    prefix = 'windows'
elif os.name == 'posix':
    if platform.machine() == 'armv7l':
        prefix = 'linux-armv7'
    elif platform.machine() == 'x86_64':
        prefix = 'linux-x86-64'
if prefix:
    METADATA_BASE_URL = f'http://localhost:8000/{prefix}/metadata/'
    TARGET_BASE_URL = f'http://localhost:8000/{prefix}/targets/'
else:
    # platform not supported
    pass
@dennisvang dennisvang added the question This is a request for clarification label Sep 19, 2023
@dennisvang
Copy link
Owner

dennisvang commented Sep 19, 2023

@Slarag That's a good question.

Is it possible to serve those platform-specific bundles in one repository?

No, not yet, unfortunately.

In principle, as far as the underlying TUF (python-tuf) repository is concerned, it should be perfectly fine to put all your platform-specific bundles in a single repository, as long as there is some way to distinguish the bundles by filename.

However, tufup does not yet know how to deal with these filenames on the repository side:

Currently, tufup assumes that the filename is composed of an app name and a version specifier:

filename_pattern = '{name}-{version}{suffix}'

There is no platform specifier in there (yet).

If yes, how does the client know which bundle it should download and use?

In any case, the client would need to use some mechanism, like the one you proposed above, to determine a platform specifier (your prefix).

If not, what do you think would be a good approach? Serve seperate repositories for each target platform? ...

For now, I think your best option would indeed be to serve separate repositories for each platform, as you proposed.

I am planning to look into options for adding platform specifiers, similar to wheel filenames (specifically the platform tag), but that is going to take some time.

@dennisvang dennisvang added the enhancement New feature or request label Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question This is a request for clarification
Projects
None yet
Development

No branches or pull requests

2 participants