About this answer
I have created one node.js project called simpleWeb. The project contains package.json and index.js.
index.js
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('How are you doing');
});
app.listen(8080, () => {
console.log('Listening on port 8080');
});
This answer is Part II of the accepted answer above.
package.json
{
"dependencies": {
"express": "*"
},
"scripts": {
"start": "node index.js"
}
}
I have also created one Dockerfile to create the docker image for my node.js project.
Before going into details, consider the two gifs below. For a range of different iterable
lengths, they show how the two compared algorithms chunk the passed iterable
(it will be a sequence by then) and how the resulting tasks might be distributed. The order of workers is random and the number of distributed tasks per worker in reality can differ from this images for light taskels and or taskels in a Wide Scenario. As mentioned earlier, overhead is also not included here. For heavy enough taskels in a Dense Scenario with neglectable transmitted data-sizes, real computations draw a very similar picture, though.
Dockerfile
# Specify a base image
FROM node:alpine
# Install some dependencies
COPY ./ ./
RUN npm install
# Default command
CMD ["npm", "start"]
While I am tried to build the docker image using "docker build ." command it is throwing below error.
As shown in chapter "5. Pool's Chunksize-Algorithm", with Pool's chunksize-algorithm the number of chunks will stabilize at n_chunks == n_workers * 4
for big enough iterables, while it keeps switching between n_chunks == n_workers
and n_chunks == n_workers + 1
with the naive approach. For the naive algorithm applies: Because n_chunks % n_workers == 1
is True
for n_chunks == n_workers + 1
, a new section will be created where only a single worker will be employed.
Error Logs
simpleweb » docker build . ~/Desktop/jaypal/Docker and Kubernatise/simpleweb [+] Building 16.9s (8/8) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 37B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/node:alpine 8.7s => [auth] library/node:pull token for registry-1.docker.io 0.0s => [internal] load build context 0.0s => => transferring context: 418B 0.0s => [1/3] FROM docker.io/library/node:alpine@sha256:5b91260f78485bfd4a1614f1afa9afd59920e4c35047ed1c2b8cde4f239dd79b 0.0s => CACHED [2/3] COPY ./ ./ 0.0s => ERROR [3/3] RUN npm install 8.0s ------ > [3/3] RUN npm install: #8 7.958 npm ERR! Tracker "idealTree" already exists #8 7.969 #8 7.970 npm ERR! A complete log of this run can be found in: #8 7.970 npm ERR! **/root/.npm/_logs/2020-12-24T16_48_44_443Z-debug.log** ------ executor failed running [/bin/sh -c npm install]: exit code: 1
Naive Chunksize-Algorithm:
The log file above it is providing one path "/root/.npm/_logs/2020-12-24T16_48_44_443Z-debug.log" where I can find the full logs.
But, The above file is not present on my local machine.
I don't understand what is the issue.