Skip to content

Snap updated to 3.3.3#119

Merged
big-r81 merged 47 commits intoapache:mainfrom
sklassen:snap-3.3.2
Jan 2, 2024
Merged

Snap updated to 3.3.3#119
big-r81 merged 47 commits intoapache:mainfrom
sklassen:snap-3.3.2

Conversation

@sklassen
Copy link
Copy Markdown
Contributor

@sklassen sklassen commented Nov 5, 2023

Overview

Updated README-SNAP.md (removed process monitor; replace passwords, uuid and secrets with environment variables; showed bash scripts need to generate passwords, uuids and secrets.)

Updated hook scripts. configure now uses sed in-place mode; install now supports multiple instances; post refresh is a copy of install, possibly needed for those that transition from 2.x to 3.x

Rewrote snapcraft yaml to use version 3.3.2 from the tar release.

.gitignore now also ignores all .snap files.

Testing recommendations

I've release this version to couchdb-sklassen.

GitHub issue number

Fixes #105

Checklist

  • [ X ] Code is written and works correctly;
  • [ X ] Changes are covered by tests;
  • [ X ] Documentation reflects the changes;

wohali and others added 30 commits February 27, 2020 21:22
./data points to /var/snap/couchd/common/data
Added warning on /var size and replaced the building snap section
There is no make install. cp the files instead.
Comment thread README-SNAP.md
Comment thread README-SNAP.md Outdated
Comment thread snap/snapcraft.yaml Outdated
Comment thread README-SNAP.md Outdated
@big-r81
Copy link
Copy Markdown
Contributor

big-r81 commented Nov 11, 2023

Hey Simon @sklassen, i tried the snapcraft remote-build tool, but it fails. I uploaded the log file. I don't know if it's a problem of the remote build or with the snap .
couchdb_amd64.1.txt

@sklassen
Copy link
Copy Markdown
Contributor Author

Hey Simon @sklassen, i tried the snapcraft remote-build tool, but it fails. I uploaded the log file. I don't know if it's a problem of the remote build or with the snap . couchdb_amd64.1.txt

I ran and also saw the same error. It did worked on a previous version of snapcraft. The arguments verbose has also changed since last I ran it. Checking the logs and comparing to previous runs, I can see it executing configure but not make. It worked when I hand ran the override in the build directory and then manually ran snapcraft prime

Maybe something with newline.

override-build: ./configure --disable-docs --spidermonkey-version 91 && make release && cp -r rel/couchdb/* $SNAPCRAFT_PART_INSTALL

This worked for me locally and when running remote-build. This is the snapcraft location and version I used.

/snap/bin/snapcraft
root@cdb22:~/src/github.com/sklassen/couchdb-pkg# snapcraft --version
snapcraft 7.5.3   

After which

Build status as of 2023-11-13 18:17:58.993147:
	arch=amd64	state=Successfully built
	arch=arm64	state=Successfully built
Snapped couchdb_3.3.2_amd64.snap
Build log available at 'couchdb_amd64.1.txt'
Snapped couchdb_3.3.2_arm64.snap
Build log available at 'couchdb_arm64.1.txt'
Build complete.

Try again and see if it works for you. You should then see a couchdb_3.3.2_amd64.snap and couchdb_3.3.2_arm64.snap.

It would be better if we didn't have to have an override-build. It is needed because i) couchdb configure doesn't have a --prefix (I believe it did in the 2.3.x branch but disappeared at some point) and ii) the Makefile is missing install. With these the snapcraft autoconf module should work without override.

@big-r81
Copy link
Copy Markdown
Contributor

big-r81 commented Nov 13, 2023

Hey Simon,

I tested your latest updates and it work for me. I tried to build the snaps for all other architectures too (except i386). Great work so far!

We are building binary packages (.deb) for Debian and Ubuntu distributions. Could we use this instead of building it again from source?

@sklassen
Copy link
Copy Markdown
Contributor Author

We are building binary packages (.deb) for Debian and Ubuntu distributions. Could we use this instead of building it again from source?

They are different paradigms and shoehorning an old file format into a new one seems perverse.

On the practical side, CouchDB .deb's /opt/ clashes within .snap's /snap/ and /var/snap structure. But the stronger case is on the principle side. Snaps security enhancement over .deb comes from the snapcraft build ensuring that the source is untainted by outside assets. By adding an build-override that copies binaries from -- official while it might be -- apache server goes against this spirit. The yaml file wants a source, I say give it the source.

@big-r81
Copy link
Copy Markdown
Contributor

big-r81 commented Nov 14, 2023

We are building binary packages (.deb) for Debian and Ubuntu distributions. Could we use this instead of building it again from source?

They are different paradigms and shoehorning an old file format into a new one seems perverse.

On the practical side, CouchDB .deb's /opt/ clashes within .snap's /snap/ and /var/snap structure. But the stronger case is on the principle side. Snaps security enhancement over .deb comes from the snapcraft build ensuring that the source is untainted by outside assets. By adding an build-override that copies binaries from -- official while it might be -- apache server goes against this spirit. The yaml file wants a source, I say give it the source.

Ok, got it.

One question to the Base snap. Can a core22 base run on an Ubuntu 18.04 or does this base restrict to a special version?

@sklassen
Copy link
Copy Markdown
Contributor Author

One question to the Base snap. Can a core22 base run on an Ubuntu 18.04 or does this base restrict to a special version?

It can. In the past I was running core20 on a Ubuntu 16.04 for the longest time. I think 16.04 is the oldest supported vintage. The same applies for core22, the snap while confining some system calls, abstracts permitted system calls between the snap and the base system. It's pretty useful for those edge cases with old hardware or dated OSs. (You know, like when you have a collection of unreliable common hardware that you want to network together).

Comment thread snap/snapcraft.yaml Outdated
Comment thread README-SNAP.md Outdated
@big-r81 big-r81 changed the title Snap updated to 3.3.2 Snap updated to 3.3.3 Jan 2, 2024
@big-r81 big-r81 merged commit 4dbff64 into apache:main Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants