sen2cor docker

Hi,

Is there anyone who has tried to build a Docker image for sen2cor?
I want to build a docker-image for sen2cor. This becomes easy to port it to other machines.
I have tried and I am getting errors.

I have created docker for sen2cor. It is building successfully when testing I get the message;

usage: L2A_Process [-h] [--resolution {10,20,60}] [--sc_only] [--profile] directory

Sentinel-2 Level 2A Prototype Processor (Sen2Cor). Version: 2.0.6, created:
2015.12.02, supporting Level-1C product version: 13.

positional arguments:
directory             Directory where the Level-1C input files are located

optional arguments:
-h, --help            show this help message and exit
--resolution {10,20,60}
                    Target resolution, must be 10, 20 or 60 [m]
--sc_only             Performs only the scene classification at 60m
                    resolution
 --profile             Profiles the processor's performance

However, when running I get the message below:

Traceback (most recent call last):
File "/opt/conda/bin/L2A_Process", line 9, in 
load_entry_point('sen2cor==2.0.6', 'console_scripts', 'L2A_Process')()
File "/opt/conda/lib/python2.7/site-packages/sen2cor-2.0.6-py2.7.egg/sen2cor/L2A_Process.py",   line 237, in main
processor = L2A_Process(directory)
File "/opt/conda/lib/python2.7/site-packages/sen2cor-2.0.6-py2.7.egg/sen2cor/L2A_Process.py",  line 21, in init
self.config = L2AConfig(workdir)
File "/opt/conda/lib/python2.7/site-packages/sen2cor-2.0.6-py2.7.egg/sen2cor/L2A_Config.py", line 50, in init
with open(self._processingEstimationFn, 'a') as configFile:
IOError: [Errno 2] No such file or directory: '/sen2cor/cfg/.estimation'
done

Does anyone know what I could be missing in my Dockerfile or docker-compose file?

Thanks

1 Like

Hi lvhengani, from the error output it is difficult to debug the issue, could you post your Dockerfile and the command used to run the container, so I can do some further investigation.

Maybe useful is a repository on GitHub I setup to share efforts developing ‘community maintained SNAP Docker containers’; feel free to browse, borrow and/or contribute. So far I did not get Sen2Cor setup, but considering the dependencies/complexities of getting it working this is an ideal candidate. https://github.com/edwardpmorris/docker-snap

Also, included is a post about ‘headless’ installation in Unix (for setting up Docker containers).

regards Ed.

Hi Edward,

I have created the docker and its working but I still have some issues.
1 It only works on the entire scene, I am looking for a solution that
can work on a granule,
2 Somehow it is unable to process my given resolution. For instance
if I choose resolution of 10 meters (L2A_Process --resolution 10
–profile /path/to/sentinel2_data/csene), it will process all
resolutions (60,20 and 10),
3 Also the processing does not complete, it will only process certain
granules in a scene and fail.

I will create the a github repository and share the dockerfile and
corresponding files with you and I will also appreciate any inputs.

Kind regards,
Lufuno Vhengani

“Edward P. Morris” forum@step-email.net 25/04/16 11:21 AM >>>

                              edwardpmorris               
           April 25                                                 
    Hi lvhengani, from the error output it is difficult to debug the

issue, could you post your Dockerfile and the command used to run the
container, so I can do some further investigation.
Maybe useful is a repository on GitHub I setup to share efforts
developing ‘community maintained SNAP Docker containers’; feel free to
browse, borrow and/or contribute. So far I did not get Sen2Cor setup,
but considering the dependencies/complexities of getting it working this
is an ideal candidate. https://github.com/edwardpmorris/docker-snap
Also, included is a post about ‘headless’ installation in Unix (for
setting up Docker containers).

      Enhancement: Non-interactive installation of

esa-snap_sentinel_unix_2_0_2.sh snap
What I want to do: I am setting up a number of Docker containers so
as to have an isolated processing environment for testing different snap
versions and configurations, as well as deploy on cloud instances and
develop work-flows in isolated environments with partners. At present,
these are headless containers which use the command-line program gpt.
Problem: esa-snap_sentinel_unix_2_0_2.sh is interactive and the
mechanism for passing installation options is either not available or
not document…

regards Ed.
Visit Topic or reply to this email to respond

To stop receiving notifications for this particular topic, click
here. To unsubscribe from these emails, change your user preferences

NaN.

This message is subject to the CSIR’s copyright terms and conditions,
e-mail legal notice, and implemented Open Document Format (ODF)
standard.
The full disclaimer details can be found at
http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by
MailScanner,
and is believed to be clean.

Please consider the environment before printing this email.

This message is subject to the CSIR’s copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.

Please consider the environment before printing this email.

Hi Edward,

I have loaded the sen2cor docker at
https://github.com/lvhengani/sen2cor_docker.
The instructions are in the README file and you are welcome to edit the
dockerfile or the docker-compose file.
Your inputs and comments are welcome, I am still new to using docker.

Many thanks,
Lufuno Vhengani.


L M Vhengani
EO Applications Technologist

Earth Observation Science and IT
Meraka Institute
Council for Scientific and Industrial Research
PO Box 395
Pretoria
0001

Tel: +27 12 841 2819
Email: lvhengani@csir.co.za
Web: www.csir.co.za


“Edward P. Morris” forum@step-email.net 25/04/16 11:21 AM >>>

                              edwardpmorris               
           April 25                                                 
    Hi lvhengani, from the error output it is difficult to debug the

issue, could you post your Dockerfile and the command used to run the
container, so I can do some further investigation.
Maybe useful is a repository on GitHub I setup to share efforts
developing ‘community maintained SNAP Docker containers’; feel free to
browse, borrow and/or contribute. So far I did not get Sen2Cor setup,
but considering the dependencies/complexities of getting it working this
is an ideal candidate. https://github.com/edwardpmorris/docker-snap
Also, included is a post about ‘headless’ installation in Unix (for
setting up Docker containers).

      Enhancement: Non-interactive installation of

esa-snap_sentinel_unix_2_0_2.sh snap
What I want to do: I am setting up a number of Docker containers so
as to have an isolated processing environment for testing different snap
versions and configurations, as well as deploy on cloud instances and
develop work-flows in isolated environments with partners. At present,
these are headless containers which use the command-line program gpt.
Problem: esa-snap_sentinel_unix_2_0_2.sh is interactive and the
mechanism for passing installation options is either not available or
not document…

regards Ed.
Visit Topic or reply to this email to respond

To stop receiving notifications for this particular topic, click
here. To unsubscribe from these emails, change your user preferences

NaN.

This message is subject to the CSIR’s copyright terms and conditions,
e-mail legal notice, and implemented Open Document Format (ODF)
standard.
The full disclaimer details can be found at
http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by
MailScanner,
and is believed to be clean.

Please consider the environment before printing this email.

This message is subject to the CSIR’s copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.

Please consider the environment before printing this email.

For point 1:
1 It only works on the entire scene, I am looking for a solution that
can work on a granule

I did something like that on https://github.com/ec-ecopotential/dcs-sen2cor
I’m not sure how “exportable” it is since it relies on queries to a catalogue that contains S2 products and tiles. Nevertheless it shows an approach.

Cheers!

@lvhengani and @fabricebrito great examples! Thanks for sharing.

Will do some testing and report back.

Hi Edward,

My docker file is at https://github.com/lvhengani/sen2cor_docker.
Its building and running but there are following issues:
1 its failing to choose the desired resolution
2 It fails after processing a few granules, in other words, it does not finish the process.

Please also test mine.

curious way to define “running successfully”…