jupyterlab/hub-extension#0.12.0" is not compatible with the current JupyterLab - jupyter

I want to install the littlest jupyterhub via .gitlab-ci.yml in a subdomain.
Here is my .gitlab-ci.yml. I get this error message. I need a little help to fix this error message. I know the littlest jupyterhub is still in beta.
Is it possible to add packages like pandas, mathplotlib to install with a shell script?
$ curl https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py | sudo python3 - --admin klein
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 2682 100 2682 0 0 24381 0 --:--:-- --:--:-- --:--:-- 24381
Checking if TLJH is already installed...
Setting up hub environment
Installed python & virtual environment
Set up hub virtual environment
Setting up TLJH installer...
Setup tljh package
Starting TLJH installer...
> /usr/bin/npm pack #jupyterlab/hub-extension
Incompatible extension:
"#jupyterlab/hub-extension#0.12.0" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab Extension Package
>=0.18.3 <0.19.0 >=0.19.1 <0.20.0 #jupyterlab/application
>=0.18.3 <0.19.0 >=0.19.1 <0.20.0 #jupyterlab/apputils
Found compatible version: 0.11.0
> /usr/bin/npm pack #jupyterlab/hub-extension#0.11.0
> node /opt/tljh/user/lib/python3.6/site-packages/jupyterlab/staging/yarn.js install
> node /opt/tljh/user/lib/python3.6/site-packages/jupyterlab/staging/yarn.js run build
System has not been booted with systemd as init system (PID 1). Can't operate.
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 447, in <module>
main()
File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 436, in main
ensure_jupyterhub_service(HUB_ENV_PREFIX)
File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 141, in ensure_jupyterhub_service
systemd.reload_daemon()
File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/systemd.py", line 19, in reload_daemon
], check=True)
File "/usr/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['systemctl', 'daemon-reload']' returned non-zero exit status 1.
Downloading traefik 1.6.5...
ERROR: Job failed: exit code 1
image: ubuntu:latest
before_script:
- apt-get update
- apt-get install -y curl git ssh python3 rsync sudo
- git submodule update --init --recursive
stages:
- test
- deploy
test_job:
stage: test
script:
- curl
https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py | sudo python3 - --admin admin
deploy:
stage: deploy
script:
- curl
https://raw.githubusercontent.com/jupyterhub/the-littlest jupyterhub/master/bootstrap/bootstrap.py | sudo python3 - --admin adminn
- mkdir .public
- cp -r * .public
- mv .public public
- mkdir "${HOME}/.ssh"
- echo "${SSH_HOST_KEY}" > "${HOME}/.ssh/known_hosts"
- echo "${SSH_PRIVATE_KEY}" > "${HOME}/.ssh/id_rsa"
- chmod 700 "${HOME}/.ssh/id_rsa"
- rsync -hrvz --delete --exclude=_ public/ user#example.com:www/jupyter/
artifacts:
paths:
- public
only:
- master

Related

MariaDB fails to start in Github workflow

I'm building an app that needs MariaDB 10.3 for testing in a CI pipeline. I'm trying to set this up with Github actions but I'm having trouble getting MariaDB to start. The ubuntu runner includes MySQL 8.0 by default so my workflow removes that first and then installs MariaDB, but MariaDB fails to start. At first I saw this error:
2022-09-17T01:24:30.8867144Z + sudo cat /var/log/mysql/error.log
2022-09-17T01:24:30.8926847Z 2022-09-17 1:24:20 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2022-09-17T01:24:30.8927599Z 2022-09-17 1:24:20 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2022-09-17T01:24:30.8928456Z 2022-09-17 1:24:21 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-09-17T01:24:30.8929215Z 2022-09-17 1:24:21 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-09-17T01:24:30.8930300Z 2022-09-17 1:24:21 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2022-09-17T01:24:30.8930738Z 2022-09-17 1:24:21 0 [ERROR] Aborting
I think this is because MySQL 8.0 leaves behind some old files, so I added a step to remove /var/lib/mysql but now the action stalls after the MariaDB installation.
I made a copy in a new public repo to show the issue here: https://github.com/llamafilm/mariadb_test/actions/runs/3071684353/jobs/4962586417
The workflow is like this:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v3
- name: Install dependencies
run: |
set -x
sudo apt update
sudo apt autoremove mysql*
- name: Look around
run: |
set -x
sudo ls -l /var/lib/mysql
sudo rm -rf /var/lib/mysql
- name: Install MariaDB
run: |
sudo apt install -y mariadb-server-10.3
- name: Validate DB
run: |
set -x
sudo cat /var/log/mysql/error.log
sudo ls -l /var/lib/mysql
mysql -e "SHOW STATUS"

Error while build image via gitlab cd/cd - Error while fetching server API version

Operation system CentOS Linux release 8.3.2011 x86_64
I try build image when push to master, this is my simple ci/cd config file .gitlab-ci.yml
image:
name: docker/compose:alpine-1.29.2
entrypoint: [""]
stages:
- build
build-job:
stage: build
script:
- echo $(whoami)
- docker -v
- docker-compose --version
- docker-compose build --no-cache
- docker-compose push
- echo "Compile complete."
only:
- master
While pipeline running, i have next error
$ echo $(whoami)
root
$ docker -v
Docker version 19.03.15, build 99e3ed8
$ docker-compose --version
docker-compose version 1.29.2, build 5becea4
$ docker-compose build --no-cache
[21] Failed to execute script docker-compose
Traceback (most recent call last):
File "urllib3/connectionpool.py", line 677, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1277, in request
File "http/client.py", line 1323, in _send_request
File "http/client.py", line 1272, in endheaders
File "http/client.py", line 1032, in _send_output
File "http/client.py", line 972, in send
File "docker/transport/unixconn.py", line 43, in connect
...
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 81, in main
File "compose/cli/main.py", line 200, in perform_command
File "compose/cli/command.py", line 70, in project_from_options
File "compose/cli/command.py", line 153, in get_project
File "compose/cli/docker_client.py", line 43, in get_client
File "compose/cli/docker_client.py", line 170, in docker_client
File "docker/api/client.py", line 197, in __init__
File "docker/api/client.py", line 222, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
I checked permission on sock files
ls -la /var/run/docker.sock
srw-rw-rw- 1 root docker 0 Feb 1 10:05 /var/run/docker.sock
ls -la /run/containerd/containerd.sock
srw-rw-rw- 1 root root 0 Feb 1 10:05 /run/containerd/containerd.sock
Docker service is running on host machine
systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2022-02-01 10:05:10 MSK; 27min ago
Docs: https://docs.docker.com
Main PID: 10698 (dockerd)
Tasks: 10
Memory: 430.4M
CGroup: /system.slice/docker.service
└─10698 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
...
Have anybody ideas?
I had a same issue .Here is a solution
sudo service docker start
or you can list images
docker images
Need transfer socket from host machine for each gitlab runner in /etc/gitlab-runner/config.toml (default path)
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]

AWS Build Project service docker-compose build command not working

I want to build docker images and push into ECR for that I have written below buildspect.yml file and build my project using AWS build project service.
My buildspec.yml file is as below:
version: 0.2
phases:
install:
runtime-versions:
docker: 18
commands:
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://localhost:2375 --storage-driver=overlay2&
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
pre_build:
commands:
- $(aws ecr get-login --no-include-email --region ${AWS_DEFAULT_REGION})
- REPOSITORY_URI_SERVER=<accountnumber>.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${IMAGE_NAME}
build:
commands:
- docker-compose build
post_build:
commands:
- docker-compose push
While I do build using AWS build project service then I will get an error like:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
[Container] 2020/07/10 01:57:15 Command did not exit successfully timeout 15 sh -c "until docker info; do echo .; sleep 1; done" exit status 124
[Container] 2020/07/10 01:57:15 Phase complete: INSTALL State: FAILED
[Container] 2020/07/10 01:57:15 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: timeout 15 sh -c "until docker info; do echo .; sleep 1; done". Reason: exit status 124
I have tried to write buildspect.yml file as below
I have added an artifact tag in my file that is the place where my project build is a store.
post_build:
commands:
- docker-compose push
- printf '[{"name":"<name of container>","imageUri":"<path of your image"}]' > imagedefinitions.json
- cat imagedefinitions.json
artifacts:
files: imagedefinitions.json
I got success in it.

Docker compose install error 'curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104' in Ubuntu

I am trying to install docker compose on the Ubuntu 18.04.2 LTS.
I tried installing using the official link here and followed the Docker Compose documentation given, but when i run the command
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
then after some time it gives me this error
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 617 0 617 0 0 613 0 --:--:-- 0:00:01 --:--:-- 613
24 8280k 24 2056k 0 0 789 0 2:59:06 0:44:27 2:14:39 0
**curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104**
Kindly help me on this i have tried many times but it is not working.
I had the same problem. I assume that you are using Docker Docs, which are usually outdated. You should go to Docker Compose Github instead.
Solution
1 - Open Linux Terminal by pressing Ctrl + Alt + T
2 - Install curl:
sudo apt install curl
3 - Turn on root privileges in terminal for your user (something like admin in Windows OS), with command:
sudo -i
4 - Go to Docker Compose Github. In releases you will find this code. Run it in your linux terminal.
curl -L https://github.com/docker/compose/releases/download/1.25.1-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
5 - Turn off root privileges in terminal for your user, with command:
exit
6 - Check if docker-compose is installed with command:
docker-compose version
Outcome: In your terminal, you should see docker-compose version number and some other informations.

How to create a dind docker image with azure-cli on Alpine linux?

I am trying to install the azure-cli in the dind:latest image based on alpine.
For context, I want to use it to connect to AKS and deploy an app to Kubernetes via Gitlab.
In my gitlab-ci.yml file I start with this
image: docker:latest
services:
- docker:dind
and then I try to install the azure-cli
deploy-to-k8s--dev: # k8s namespace "dev"
stage: deploy-to-k8s
# image: microsoft/azure-cli
script:
# I need the azure cli in the dind:latest container
# so install bash,curl and finally the cli
- apk update
- apk upgrade
- apk add bash
- apk add --no-cache curl
- curl -L https://aka.ms/InstallAzureCli | bash
- az
and I get the following error
$ curl -L https://aka.ms/InstallAzureCli | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 167 100 167 0 0 167 0 0:00:01 --:--:-- 0:00:01 644
100 1367 100 1367 0 0 1367 0 0:00:01 --:--:-- 0:00:01 1367
mktemp: Invalid argument
ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1
It is the first time that I try to work with Alpine Linux and I have no idea how it is built and what tools it uses...
Has anyone any suggestion?
EDIT
based on the accepted answer this is the final code that works
deploy-to-k8s--dev: # k8s namespace "dev"
stage: deploy-to-k8s
script:
# I need the azure cli in the dind:latest container
# so install bash,curl and finally the cli
- apk update
- apk upgrade
- apk add bash make py-pip
- apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python2-dev
- pip install azure-cli
- apk del --purge build
- az -h
This helped me in one of my alpine based image
apk update
apk add bash py-pip
apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python- dev
pip install azure-cli
apk del --purge build