daemon.files module
daemon.files.store_files_in_workspace(workspace_id, files, logger)[source]
Store the uploaded files in local disk
Parameters
workspace_id (DaemonID) – workspace id representing the local directory
files (
List
[UploadFile
]) – files uploaded to the workspace endpointlogger (JinaLogger) – JinaLogger to use
Return type
None
daemon.files.is_requirements_txt(filename)[source]
Check if filename is of requirements.txt format
Parameters
filename – filename
Return type
bool
Returns
True if filename is in requirements.txt format
class daemon.files.DaemonFile(workdir, logger=None)[source]
Bases: object
Object representing .jinad file
extension = ‘.jinad’
property dockerfile: str
Property representing dockerfile value
Return type
str
Returns
daemon dockerfile in the daemonfile
property python
Property representing python version
Returns
python version in the daemonfile
property jinav
Property representing python version
Returns
python version in the daemonfile
property run: str
Property representing run command
Return type
str
Returns
run command in the daemonfile
property ports: List[int]
Property representing ports
Return type
List
[int
]Returns
ports to be mapped in the daemonfile
property requirements: str
pip packages mentioned in requirements.txt
Return type
str
Returns
space separated values
property dockercontext: str
directory for docker context during docker build
Return type
str
Returns
docker context directory
property dockerargs: Dict
dict of args to be passed during docker build
Note
For DEVEL, we expect an already built jina image to be available locally. We only pass the pip requirements as arguments. For DEFAULT (cpu), we pass the python version, jina version used to pull the image from docker hub in addition to the requirements.
Return type
Dict
Returns
dict of args to be passed during docker build
process_file()[source]
Process .jinad file and set args
Return type
None
set_args(file)[source]
read .jinad file & set properties
Parameters
file (
Path
) – .jinad filepathReturn type
None