Following my questions in https://lists.samba.org/archive/samba/2019-July/224115.html and the lack of recent builds of Samba in Ubuntu, I started to build Samba on my own. I installed a new virtual machine with Ubuntu 18.04.2 (LTS) server (+ssh), installed docker and docker-compose, and then tried to build using the following Dockerfile: --- Dockerfile begin --- # https://docs.docker.com/develop/develop-images/multistage-build/ # https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact # https://wiki.samba.org/index.php/Build_Samba_from_Source # obviously you can only switch to distros also using apt :( ARG distro=ubuntu:18.04 ARG dependencylist=ubuntu1804 ARG version=4.10.5 FROM ${distro} as samba-dev ARG dependencylist ARG version RUN apt-get update && apt-get install -y wget # TODO: can we reference the release branch of the version above? RUN wget -O deps "https://git.samba.org/?p=samba.git;a=blob_plain;f=bootstrap/generated-dists/${dependencylist}/bootstrap.sh;hb=master" RUN chmod +x deps && ./deps RUN wget https://download.samba.org/pub/samba/stable/samba-${version}.tar.gz RUN tar -zxf samba-${version}.tar.gz RUN cd samba-${version} && ./configure --enable-selftest && make && make test && make install --- Dockerfile end --- I thought it is a good idea to also run tests... unfortunately they fail. Because of that I essentially ran the same steps also on the host, and they fail as well, though apparently not exactly the same tests fail. I noticed that during installation of krb on host, a configuration was created, whereas in the container the runlevel was inadequate. Because of that observation I suspect that it is a configuration or environment issue, as neither host nor container have a real configuration to run samba - but what configuration is really required to run the tests successfully? krb5.conf, smb.conf, a domain join, or what? Thanks & Best Regards, Joachim
On 05/07/2019 21:12, Joachim Lindenberg via samba wrote:> Following my questions in https://lists.samba.org/archive/samba/2019-July/224115.html and the lack of recent builds of Samba in Ubuntu, I started to build Samba on my own. > I installed a new virtual machine with Ubuntu 18.04.2 (LTS) server (+ssh), installed docker and docker-compose, and then tried to build using the following Dockerfile: > > --- Dockerfile begin --- > # https://docs.docker.com/develop/develop-images/multistage-build/ > # https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact > > # https://wiki.samba.org/index.php/Build_Samba_from_Source > # obviously you can only switch to distros also using apt :( > > ARG distro=ubuntu:18.04 > ARG dependencylist=ubuntu1804 > ARG version=4.10.5 > FROM ${distro} as samba-dev > ARG dependencylist > ARG version > RUN apt-get update && apt-get install -y wget > # TODO: can we reference the release branch of the version above? > RUN wget -O deps "https://git.samba.org/?p=samba.git;a=blob_plain;f=bootstrap/generated-dists/${dependencylist}/bootstrap.sh;hb=master" > RUN chmod +x deps && ./deps > RUN wget https://download.samba.org/pub/samba/stable/samba-${version}.tar.gz > RUN tar -zxf samba-${version}.tar.gz > RUN cd samba-${version} && ./configure --enable-selftest && make && make test && make install > --- Dockerfile end --- > > I thought it is a good idea to also run tests... unfortunately they fail. Because of that I essentially ran the same steps also on the host, and they fail as well, though apparently not exactly the same tests fail. I noticed that during installation of krb on host, a configuration was created, whereas in the container the runlevel was inadequate. Because of that observation I suspect that it is a configuration or environment issue, as neither host nor container have a real configuration to run samba - but what configuration is really required to run the tests successfully? krb5.conf, smb.conf, a domain join, or what? > > Thanks & Best Regards, Joachim > > >Try the configure part like this: ./configure.developer --enable-debug --enable-selftest If this doesn't help then it is probably something to do with docker, try reading this: https://wiki.samba.org/index.php/Samba_CI_on_gitlab/Debugging_CI_failures Rowland
On 7/5/2019 10:12 PM, Joachim Lindenberg via samba wrote:> Following my questions in https://lists.samba.org/archive/samba/2019-July/224115.html and the lack of recent builds of Samba in Ubuntu, I started to build Samba on my own. > I installed a new virtual machine with Ubuntu 18.04.2 (LTS) server (+ssh), installed docker and docker-compose, and then tried to build using the following Dockerfile: > > --- Dockerfile begin --- > # https://docs.docker.com/develop/develop-images/multistage-build/ > # https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact > > # https://wiki.samba.org/index.php/Build_Samba_from_Source > # obviously you can only switch to distros also using apt :( > > ARG distro=ubuntu:18.04 > ARG dependencylist=ubuntu1804 > ARG version=4.10.5 > FROM ${distro} as samba-dev > ARG dependencylist > ARG version > RUN apt-get update && apt-get install -y wget > # TODO: can we reference the release branch of the version above? > RUN wget -O deps "https://git.samba.org/?p=samba.git;a=blob_plain;f=bootstrap/generated-dists/${dependencylist}/bootstrap.sh;hb=master" > RUN chmod +x deps && ./deps > RUN wget https://download.samba.org/pub/samba/stable/samba-${version}.tar.gz > RUN tar -zxf samba-${version}.tar.gz > RUN cd samba-${version} && ./configure --enable-selftest && make && make test && make install > --- Dockerfile end --- > > I thought it is a good idea to also run tests... unfortunately they fail. Because of that I essentially ran the same steps also on the host, and they fail as well, though apparently not exactly the same tests fail. I noticed that during installation of krb on host, a configuration was created, whereas in the container the runlevel was inadequate. Because of that observation I suspect that it is a configuration or environment issue, as neither host nor container have a real configuration to run samba - but what configuration is really required to run the tests successfully? krb5.conf, smb.conf, a domain join, or what?I am not an expert on containers as well, but I ran through the process of running selftest not long ago (I did that to test an extension for IPX support that I built into the server); I was on Fedora, and it took some extra work to get all the dependencies right, anyway after that I noticed the following to get it to complete successfully: - recent Perl versions require some small update to the selftest engine: https://bugzilla.samba.org/show_bug.cgi?id=13910 - a few wrappers (e.g. libnss_wrapper.so) do not get the path right during configuration if the system ones are used instead of the ones in the build tree (at least this was the case in my environment) - I have been running it in several VMs, and I have seen that it needs 8GB of RAM to complete - there are some torture tests late in the process that are that hungry. after ./configure.developer all tests build their own local configurations, the system conf is not touched.> > Thanks & Best Regards, Joachim > > >
On 05/07/2019 22:33, Rowland penny via samba wrote>Try the configure part like this: > >./configure.developer --enable-debug --enable-selftest > >If this doesn't help then it is probably something to do with docker, tryreading this:> >https://wiki.samba.org/index.php/Samba_CI_on_gitlab/Debugging_CI_failures > >RowlandI tried both the change of configure and also the make -j mentioned on wiki. It still behaves differently in docker container than on host, and though on host it doesn?t fail as early than in container, it does not look good there either. Frankly, I don?t understand the scripts for gitlab. I?d definitely appreciate if someone more capable of interpreting the test results could have a look and advise on how to configure a host or container for testing. Thanks, Joachim
Hai Joachim, ...> > Following my questions in > https://lists.samba.org/archive/samba/2019-July/224115.html > and the lack of recent builds of Samba in Ubuntu,You could use my repo for recent samba packages. ----------- THE REPO SETUP --------------- 1) Choose http or https for you apt, both work, for https you need to : apt-get install apt-transport-https 2) Import my public key wget -O - http://apt.van-belle.nl/louis-van-belle.gpg-key.asc | apt-key add - 3) (optional) setup a header line for the repo file. echo "# AptVanBelle repo for samba." | sudo tee /etc/apt/sources.list.d/van-belle.list 4) In the line below, change the OS and/or samba version to what you want. Shown is debian stretch with samba 4.10. echo "deb http://apt.van-belle.nl/debian bionic-samba410 main contrib non-free" | sudo tee -a /etc/apt/sources.list.d/van-belle.list Greetz, Louis
Hi Louis, thanks for the offer. I am kind of struggling with the 5th step you didn?t mention -- apt-get install samba results in 4.7.6 (likely from ubuntu?), but I have no clue how to specify the version or enforce using your repository. For reference, these are the instructions I am using (note that sudo is not required in container builds, and step 3 was optional - and didn?t change anything): apt-get update && apt-get -y install apt-transport-https gnupg wget net-tools wget -O - https://apt.van-belle.nl/louis-van-belle.gpg-key.asc | apt-key add - echo "deb http://apt.van-belle.nl/ubuntu bionic-samba410 main contrib non-free" | tee -a /etc/apt/sources.list.d/van-belle.list apt-get install -y samba samba -V Thanks & Best Regards, Joachim
Hai, I only see one step you missed.. ..> -----Oorspronkelijk bericht----- > Van: Joachim Lindenberg [mailto:samba at lindenberg.one] > Verzonden: maandag 8 juli 2019 18:38 > Aan: 'L.P.H. van Belle'; samba at lists.samba.org > Onderwerp: AW: [Samba] Container setup - selftests not running? > > Hi Louis, > thanks for the offer. I am kind of struggling with the 5th > step you didn?t > mention -- apt-get install samba results in 4.7.6 (likely > from ubuntu?), > but I have no clue how to specify the version or enforce using your > repository.Thats not needed, my version is highest version.> For reference, these are the instructions I am using (note > that sudo is not > required in container builds, and step 3 was optional - and > didn?t change > anything): > apt-get update && apt-get -y install apt-transport-https gnupg wget > net-tools > wget -O - > https://apt.van-belle.nl/louis-van-belle.gpg-key.asc | apt-key add > - > echo "deb http://apt.van-belle.nl/ubuntu bionic-samba410 main contrib > non-free" | tee -a /etc/apt/sources.list.d/van-belle.listapt-get update ... apt-get install -y samba winbind attr acl And if you upgradeing samba, the use apt-get dist-upgrade You need dist-upgrade because you getting a few extra packages. Version check with: apt-cache policy samba Or once samba is installed. smbd -V Or winbindd -V Or nmbd -V Greetz, Louis