Local FTP server¶
For a development cluster (e.g., Minikube), an FTP server on the host can serve as the storage backend of TESK. Set it up as follows, then point TESK to it with ftp.hostip and the FTP credentials (see FTP and Configuration).
- Create a new user on the host
- Install vsftpd
- Make it writable. In
/etc/vsftpd.confset:
- To configure TLS with vsftpd (Optional),
if you are planning to use cwl-tes, then you have to add TLS certificate to vsftpd.
Open the vsftpd configuration file as root: Now, specify the location of our certificate, key files and other configurations to the end of the file. Save and close the file. Restart vsftpd to enable our changes If FTP server fails to start, investigate by trying to start it manually:
sudo mkdir /etc/ssl/private sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem - You may need to configure or disable firewall (such as
ufw) - Edit the input and output URLs in the task's JSON (e.g.:
examples/localftp/taskWithIO.json):
"inputs": [
{
"description": "Downloading a single file from FTP",
"name": "File from FTP",
"path": "/tes/input",
"type": "FILE",
"url": "ftp://ftp/home/tesk/input.txt" <= here
You have to use absolute paths.
Maybe because I'm not using `chroot_local_user` in FTP?
}
"outputs": [
{
"description": "Example of uploading a directory to FTP",
"name": "Dir to FTP",
"path": "/tes",
"type": "DIRECTORY",
"url": "ftp://ftp/home/tesk/output" <= and here
}
-
Configure credentials and hostIP for FTP using the Helm chart according to instructions.
hostIPneeds to be set to the IP, where containers running in your K8s see your services running on localhost. Fordockerdriver, it seems to be172.30.0.1(on Linux). For minikube with a VM driver (such as virtualbox), you can check the IP by running: -
Create the task:
cwl-tes locally with the locally installed FTP server, you need a couple more tricks:
- You need a
hostsentry with so that both cwl-tes and TESK see the local FTP at the same address. - You need a
.netrcfile. It needs to be readable only to the owner - Finally, you can run a workflow: A good workflow to test your setup is: https://github.com/uniqueg/cwl-example-workflows.git. which you need to clone
Then run the following command:
cwl-tes --tes http://minikube_ip:node_port --remote-storage-url ftp://ftp/home/tesk hashsplitter-workflow.cwl hashsplitter-test.yml
- If the workflow uses FTP inputs, adjust them, so they point to existing files on your FTP server.
For example in the hashsplitter-test.yml from the workflow above make the following changes and also
make sure the input.txt file has been uploaded to your FTP.
--input parameter (so letting cwl-tes upload an input file to FTP) fails for the proposed FTP setup. Most probably this functionality works only with chroot enabled on FTP server.