How do I use lsquic (LiteSpeed QUIC and HTTP/3 library)? - quic

https://github.com/litespeedtech/lsquic
I want to implement lsquic. after the setup in the readme, what should I do to send data from client to server and track the network traffic? For setup, do I just follow the three steps, install BoringSSL, LSQUIC and then docker? Would just copy and paste the commands in Terminal work?
Error message:
CMake Error: The current CMakeCache.txt directory /src/lsquic/CMakeCache.txt is different than the directory /Users/nini/Development/lsquic/boringssl/lsquic where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
The command '/bin/sh -c cd /src/lsquic && cmake -DBORINGSSL_DIR=/src/boringssl . && make' returned a non-zero code: 1
(base) pc-68-32:lsquic nini$ sudo docker run -it --rm lsquic http_client -s www.google.com -p / -o version=Q046
Password:
Unable to find image 'lsquic:latest' locally
docker: Error response from daemon: pull access denied for lsquic, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

You can build lsquic with docker and then run it (because of the "unable to find" error, i think you did not build the docker image). To do so, git clone (just) the lsquic repository, and run the commands given in the section titled "Building with Docker". The docker build will (o.a.) download boringssl and build it, so you don't have to do that yourself and then it will build lsquic for you.

Related

How do I fix a webui build that is causing CAfile error when git needs a cerfiticate for a npm install of noVNC

The specific error is:
11634 verbose node v12.14.1
11635 verbose npm v6.13.4
11636 error Error while executing:
11636 error /home/openbmc/code/openbmc/rpi-build/tmp/hosttools/git ls-remote -h -t https://github.com/novnc/noVNC.git
11636 error
11636 error fatal: unable to access 'https://github.com/novnc/noVNC.git/': error setting certificate verify locations:
11636 error CAfile: /opt/poky/3.1/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt
11636 error CApath: none
Testing manually:
If I run the command manually in a new shell, it fails the same, indicating it is using a default certificate path. If I run it in the shell with the environment for bitbake, it works. This is because GIT_SSL_CAINFO is properly defined.
The behavior suggests that when git is run from hosttools, it is not using the bitbake shell environment, because that environment defines a correct GIT_SSL_CAINFO with a path to the buildtools area with a valid certificate.
I assume that poky is creating a special environment for running hosttools independently from my main shell. If this is the case, there needs to be a way to add GIT_SSL_CAINFO into this environment, which I have no idea how to do.
I poked around other targets looking for clues but could not find anything that suggested to me this variable would be defined.
A search of the tree on GIT_SSL_CAINFO did not turn anything up, but it is possible there is a variable with another name.
perhaps there is a way to set http.sslCAInfo to take the place of GIT_SSL_CAINFO?
The context:
I first compiled up the raspberry pi build and tested that it runs. Then I added in meta-phosphor, which also pulls in webui.
webui has a dependency on noVNC, but with a specific version, which appears to cause this command to run and fail.
How I setup the build:
git clone https://github.com/openbmc/openbmc.git
git checkout cb91a77
# Modify layers to include meta-phosphor and webui
scripts/install-buildtools
. /home/openbmc/code/openbmc/poky/buildtools/environment-setup-x86_64-pokysdk-linux
bitbake bmap-tools-native -caddto_recipe_sysroot
. oe-init-build-env rpi-build (per session)
# Modify conf files in rpi-build
bitbake core-image-base
My work around:
sudo git config --system http.sslcainfo /home/openbmc/code/openbmc/poky/buildtools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt
I would rather handle the problem in the build, but could not find a way to do so.

Unable to find image from docker hub repository

I am a really newbie in docker and basically I've started to follow this official guide:
https://hub.docker.com/_/mongo
I've executed this commands:
step 1 --> docker pull mongo
step 2--> docker images
and the output:
REPOSITORY TAG IMAGE ID CREATED SIZE
mongo latest 3f3daf863757 2 weeks ago 388MB
step 3 --> docker run --name some-mongo -d mongo:tag
Unable to find image 'latest:tag' locally
docker: Error response from daemon: pull access denied for latest, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
Any help would be great, thanks in advance,
Please try to run with below command. you are not passing the correct tag name. available list of tag for MongoDB are here. https://hub.docker.com/_/mongo?tab=tags
docker run --name my-mongodb -d mongo:latest

How to customize a offical docker postgres image and build it?

I need to change the locale of the offical Postgres(11.4) image in order to create databases with my language.
https://github.com/docker-library/postgres/blob/87b15b6c65ba985ac958e7b35ba787422113066e/11/Dockerfile
I copied the Dockerfile and docker-entrypoint.sh from offical postgres image( I did not add the customization yet)
aek#ubuntu:~/Desktop/Docker$ ls
docker-entrypoint.sh Dockerfile
aek#ubuntu:~/Desktop/Docker$ sudo docker build -t postgres_custom .
Step 24/24 : CMD ["postgres"]
---> Running in 8720b67094b1
Removing intermediate container 8720b67094b1
---> eb63a36ee850
Successfully built eb63a36ee850
Successfully tagged postgres_custom:latest
Image is successfully built but when I try to run it I get error below:
aek#ubuntu:~/Desktop/Docker$ docker run --name postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres_custom
d75b25367f019e3398f7daff78260e87c02a0c1898658585ec04bbd219bbe3e9
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"docker-entrypoint.sh\": executable file not found in $PATH": unknown.
Can't figure out what is wrong with the entrypoint.sh. Can you please help me?
you need to make entrypoint.sh executable :
RUN chmod +x /path/to/entrypoint.sh
as you said that you copied it without any further changes.

Docker Madlib Postgres

I was trying to install Apache MADLib on Postgres. Having difficulty with YUM approach I moved to Docker approach as suggested by this website https://pgxn.org/dist/madlib/
I was able to pull docker image as suggested at para 1. Now at para 2 I am stuck with comment "Path to incubator-madlib directory". I am not able to understand whether it should be the URL to MADLib Incubator such as "https://github.com/apache/incubator-madlib" or it should refer to local disk area. It would be great by giving an example of how to run this command.
2) Launch a container corresponding to the MADlib image, mounting the
source code folder to the container:
docker run -d -it --name madlib \ -v (path to incubator-madlib directory):/incubator-madlib/ madlib/postgres_9.6
The (path to incubator-madlib directory) refers to wherever you have git cloned the MADlib code base to on your machine. Say for example, your home directory in your machine is /home/xyz/ and you have cloned the MADlib code base there, you should have a directory called /home/xyz/incubator-madlib. You can now run the docker command documented in the MADlib repo as follows:
docker run -d -it --name madlib -v /home/xyz/incubator-madlib/:/incubator-madlib/ madlib/postgres_9.6
You were probably getting the Permission denied docker:... error after trying Robert's suggestion because the $(pwd) was not referring to your incubator-madlib source code folder, but was referring to /var/lib/docker/devicemapper/devicemapper/data, which should not be the case. In any case, it might be a better idea to provide the incubator-madlib directory's absolute path in the docker command, as specified above.
As is documented, that is the directory on your computer where the source code resides:
where incubator-madlib is the directory where the MADlib source code resides.
So, supossing that you have downloaded the source code in ./incubator-madlib, run as this:
docker run -d -it --name madlib -v $(pwd)/incubator-madlib:/incubator-madlib/ madlib/postgres_9.6
Then see what the container logs:
docker logs -f madlib

Can't clone public repo from within Dockerfile

I have the following line in my Dockerfile:
RUN git clone https://github.com/assafg/youtube-remote.git ./youtube-remote
When executing sudo docker build -t 'yremote' .
I get the following error:
Cloning into './youtube-remote'... fatal: unable to access
'https://github.com/assafg/youtube-remote.git/': Could not resolve
host: github.com The command '/bin/sh -c git clone
https://github.com/assafg/youtube-remote.git ./youtube-remote'
returned a non-zero code: 128
Running clone command from command line works fine.
This can happen if your container can't connect to the internet. Possibly because it was started with a weird networking option? Run this command to check default internet connectivity:
docker run ubuntu apt install -y git && \
git clone https://github.com/assafg/youtube-remote.git ./youtube-remote
If that container successfully pulls down the repo, it probably means the first container has a networking problem. Try to restart, or change networking settings.
Docker Network just became a first class citizen in the Docker ecosystem. It's a really fast-moving project. This advice applies to v1.8
This is not a very scientific answer but sometimes docker restart helps especially in cases connected with docker network.