web-dev-qa-db-fra.com

La configuration du cycle de vie est supérieure à 5 minutes, la commande nohup ne fonctionne pas

J'essaie d'installer un certain nombre de dépendances pour mon ordinateur portable Jupyter, mais j'aimerais qu'ils soient permanents pour me sauver 20 minutes chaque fois que je redémarre le cahier. J'ai opté pour utiliser une configuration de cycle de vie, cependant, mon script prend plus de 5 minutes à courir. J'ai trouvé cet article ( https://aws.amazon.com/premiumsupport/knowledge-center/sagemaker-lifecycle-script-timeout/ ) Pour aider à résoudre ce problème, mais mon ordinateur portable échoue toujours Pour commencer avec l'erreur suivante:

Notebook Instance Lifecycle Config 'arn:aws:sagemaker:eu-west-2:347285168835:notebook-instance-lifecycle-config/nbs-aap-dev-dsar' for Notebook Instance 'arn:aws:sagemaker:eu-west-2:347285168835:notebook-instance/nbs-aap-dev-dsar' took longer than 5 minutes. Please check your CloudWatch logs for more details if your Notebook Instance has Internet access.

Voici le script que j'essaie de courir:

Sudo Nohup yum install wget &
Sudo yum install autoconf &
Sudo yum install automake &
Sudo yum install libtool &
Sudo yum install jpeg &
Sudo yum install tiff &
Sudo yum install libpng &
Sudo yum install tiff2png &
Sudo yum install libtiff &
Sudo yum install autoconf aclocal automake &
Sudo yum install libtool &
Sudo yum -y install libjpeg-devel libpng-devel libpng-devel libtiff-devel zlib-devel &
Sudo yum install gcc gcc-c++ make &
Sudo wget https://github.com/DanBloomberg/leptonica/releases/download/1.82.0/leptonica-1.82.0.tar.gz &
Sudo tar xzvf leptonica-1.82.0.tar.gz &
cd leptonica-1.82.0 &
Sudo ./configure --prefix=/usr/local/ &
Sudo make &
Sudo make install &
Sudo wget https://codeload.github.com/tesseract-ocr/tesseract/tar.gz/4.1.1 &
Sudo tar -zxvf 4.1.1 &
cd tesseract-4.1.1 &
Sudo ./autogen.sh &
Sudo cp /home/ec2-user/leptonica-1.82.0/lept.pc /usr/lib64/pkgconfig/. &
Sudo LIBLEPT_HEADERSDIR=/usr/local/lib ./configure --prefix=/usr/local/ --with-extra-libraries=/usr/local/lib &
Sudo make &
Sudo make install &
export LD_LIBRARY_PATH=/usr/local/lib &
Sudo ldconfig &
Sudo wget https://github.com/tesseract-ocr/tessdata_best/raw/main/eng.traineddata &
Sudo mv -v eng.traineddata /usr/local/share/tessdata/eng.traineddata &
Sudo wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9550/ghostpdl-9.55.0.tar.gz &
Sudo tar -zxvf ghostpdl-9.55.0.tar.gz &
cd ghostpdl-9.55.0 &
Sudo ./configure --prefix=/usr/local/ &
Sudo make &
Sudo make install &
Sudo yum -y install poppler-utils &
Sudo wget https://github.com/qpdf/qpdf/releases/download/release-qpdf-10.1.0/qpdf-10.1.0.tar.gz &
Sudo tar xzvf qpdf-10.1.0.tar.gz &
cd qpdf-10.1.0 &
Sudo ./configure --prefix=/usr/local/ &
Sudo make &
Sudo make install
2
Kelly

Vous n'avez pas besoin d'ajouter AMPersand & à la fin des lignes. Cela les mettez en arrière-plan et exécutez certaines commandes en parallèle qui conduisent à des conditions impaires. Par exemple dans le code:

Sudo ./configure --prefix=/usr/local/ &
Sudo make &
Sudo make install &

la commande make commence avant la fin de configure et ne se terminera pas bien dans la plupart des cas. Pareil pour make install Il essaie d'installer le package compilé avant qu'il ne soit compilé de make si vous souhaitez mettre un script en arrière-plan, vous pouvez regrouper les commandes de cette manière:

Sudo Nohup yum -y install wget autoconf automake libtool jpeg tiff libpng tiff2png libtiff autoconf aclocal automake libtool libjpeg-devel libpng-devel libpng-devel libtiff-devel zlib-devel gcc gcc-c++ make poppler-utils 

Nohup Sudo wget https://github.com/DanBloomberg/leptonica/releases/download/1.82.0/leptonica-1.82.0.tar.gz && Sudo tar xzvf leptonica-1.82.0.tar.gz &&cd leptonica-1.82.0 && Sudo ./configure --prefix=/usr/local/ && Sudo make && Sudo make install &

Nohup Sudo wget https://codeload.github.com/tesseract-ocr/tesseract/tar.gz/4.1.1 &&Sudo tar -zxvf 4.1.1 && cd tesseract-4.1.1 && Sudo ./autogen.sh && Sudo cp /home/ec2-user/leptonica-1.82.0/lept.pc /usr/lib64/pkgconfig/. && Sudo LIBLEPT_HEADERSDIR=/usr/local/lib ./configure --prefix=/usr/local/ --with-extra-libraries=/usr/local/lib && Sudo make && Sudo make install &

Nohup export LD_LIBRARY_PATH=/usr/local/lib && Sudo ldconfig && Sudo wget https://github.com/tesseract-ocr/tessdata_best/raw/main/eng.traineddata && Sudo mv -v eng.traineddata /usr/local/share/tessdata/eng.traineddata && Sudo wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9550/ghostpdl-9.55.0.tar.gz && Sudo tar -zxvf ghostpdl-9.55.0.tar.gz && cd ghostpdl-9.55.0 && Sudo ./configure --prefix=/usr/local/ && Sudo make && Sudo make install &

Nohup Sudo wget https://github.com/qpdf/qpdf/releases/download/release-qpdf-10.1.0/qpdf-10.1.0.tar.gz && Sudo tar xzvf qpdf-10.1.0.tar.gz && cd qpdf-10.1.0 && Sudo ./configure --prefix=/usr/local/ && Sudo make && Sudo make install &
1
Romeo Ninov