<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def upload_artifacts(context, files):
 """Compress and upload the requested files from ``artifact_dir``, preserving relative paths. Compression only occurs with files known to be supported. This function expects the directory structure in ``artifact_dir`` to remain ``artifact_dir/public`` and put the files in there. Args: context (scriptworker.context.Context):
 the scriptworker context. files (list of str):
 files that should be uploaded as artifacts Raises: Exception: any exceptions the tasks raise. """

    def to_upload_future(target_path):
        path = os.path.join(context.config['artifact_dir'], target_path)
        content_type, content_encoding = compress_artifact_if_supported(path)
        return asyncio.ensure_future(retry_create_artifact(
            context,
            path,
            target_path=target_path,
            content_type=content_type,
            content_encoding=content_encoding,
        ))

    tasks = list(map(to_upload_future, files))
    await raise_future_exceptions(tasks)