  Industry 4.0 operates based on IoT devices, sensors, and actuators,
transforming the use of computing resources and software solutions in diverse
sectors. Various Industry 4.0 latency-sensitive applications function based on
machine learning to process sensor data for automation and other industrial
activities. Sending sensor data to cloud systems is time consuming and
detrimental to the latency constraints of the applications, thus, fog computing
is often deployed. Executing these applications across heterogeneous fog
systems demonstrates stochastic execution time behavior that affects the task
completion time. We investigate and model various Industry 4.0 ML-based
applications' stochastic executions and analyze them. Industries like oil and
gas are prone to disasters requiring coordination of various latency-sensitive
activities. Hence, fog computing resources can get oversubscribed due to the
surge in the computing demands during a disaster. We propose federating nearby
fog computing systems and forming a fog federation to make remote Industry 4.0
sites resilient against the surge in computing demands. We propose a
statistical resource allocation method across fog federation for
latency-sensitive tasks. Many of the modern Industry 4.0 applications operate
based on a workflow of micro-services that are used alone within an industrial
site. As such, industry 4.0 solutions need to be aware of applications'
architecture, particularly monolithic vs. micro-service. Therefore, we propose
a probability-based resource allocation method that can partition micro-service
workflows across fog federation to meet their latency constraints. Another
concern in Industry 4.0 is the data privacy of the federated fog. As such, we
propose a solution based on federated learning to train industrial ML
applications across federated fog systems without compromising the data
confidentiality.
