Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build & release arm64 #42

Merged
merged 5 commits into from
Jun 28, 2024
Merged

Build & release arm64 #42

merged 5 commits into from
Jun 28, 2024

Conversation

carlcsaposs-canonical
Copy link
Contributor

@carlcsaposs-canonical carlcsaposs-canonical commented Jun 27, 2024

No description provided.

@carlcsaposs-canonical carlcsaposs-canonical changed the title Use reusable workflows Update to 8.0.37 & add ARM Jun 27, 2024
Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update README (same as snap) and please create backlog ticket to add tests here.

Current `override-stage` has no effect on final rock

I inspected the rock we're currently building (i.e. ghcr.io/canonical/charmed-mysql:8.0.37-22.04_edge), and it looks like it doesn't contain `/var/lib/mysql`
```
root@foo-0:/# find / -name mysql
/home/mysql
/usr/lib/x86_64-linux-gnu/perl5/5.34/DBD/mysql
/usr/lib/x86_64-linux-gnu/perl5/5.34/auto/DBD/mysql
/usr/lib/mysql
/usr/share/mysql
/usr/bin/mysql
/var/log/mysql
/etc/init.d/mysql
/etc/mysql
root@foo-0:/# mysqld --initialize-insecure -u mysql
root@foo-0:/# find / -name mysql
/home/mysql
/usr/lib/x86_64-linux-gnu/perl5/5.34/DBD/mysql
/usr/lib/x86_64-linux-gnu/perl5/5.34/auto/DBD/mysql
/usr/lib/mysql
/usr/share/mysql
/usr/bin/mysql
/var/log/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/etc/init.d/mysql
/etc/mysql
```

so I think the entire `override-stage` in our rock is doing nothing
@carlcsaposs-canonical carlcsaposs-canonical changed the title Update to 8.0.37 & add ARM Build & release arm64 Jun 28, 2024
Comment on lines -35 to -58
override-stage: |
LIB_DIR=$CRAFT_STAGE/usr/lib/x86_64-linux-gnu
craftctl default
mkdir -p $CRAFT_STAGE/var/lib/mysql
ln -sf $LIB_DIR/libnuma.so.1 \
/usr/lib/x86_64-linux-gnu/libnuma.so.1
ln -sf $LIB_DIR/libaio.so.1 \
/usr/lib/x86_64-linux-gnu/libaio.so.1
ln -sf $LIB_DIR/libicuuc.so.70 \
/usr/lib/x86_64-linux-gnu/libicuuc.so.70
ln -sf $LIB_DIR/libicui18n.so.70 \
/usr/lib/x86_64-linux-gnu/libicui18n.so.70
ln -sf $LIB_DIR/libevent_core-2.1.so.7 \
/usr/lib/x86_64-linux-gnu/libevent_core-2.1.so.7
ln -sf $LIB_DIR/libevent_pthreads-2.1.so.7 \
/usr/lib/x86_64-linux-gnu/libevent_pthreads-2.1.so.7
ln -sf $LIB_DIR/libprotobuf-lite.so.23 \
/usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.23
ln -sf $LIB_DIR/libicudata.so.70 \
/usr/lib/x86_64-linux-gnu/libicudata.so.70
rm -rf /var/lib/mysql/
mysqld --initialize
cp -r /var/lib/mysql $CRAFT_STAGE/var/lib
chown 584788:584788 $CRAFT_STAGE/var/lib/mysql
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I inspected the rock we're currently building (i.e. ghcr.io/canonical/charmed-mysql:8.0.37-22.04_edge), and it looks like it doesn't contain /var/lib/mysql

root@foo-0:/# find / -name mysql
/home/mysql
/usr/lib/x86_64-linux-gnu/perl5/5.34/DBD/mysql
/usr/lib/x86_64-linux-gnu/perl5/5.34/auto/DBD/mysql
/usr/lib/mysql
/usr/share/mysql
/usr/bin/mysql
/var/log/mysql
/etc/init.d/mysql
/etc/mysql
root@foo-0:/# mysqld --initialize-insecure -u mysql
root@foo-0:/# find / -name mysql
/home/mysql
/usr/lib/x86_64-linux-gnu/perl5/5.34/DBD/mysql
/usr/lib/x86_64-linux-gnu/perl5/5.34/auto/DBD/mysql
/usr/lib/mysql
/usr/share/mysql
/usr/bin/mysql
/var/log/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/etc/init.d/mysql
/etc/mysql

so I think the entire override-stage in our rock is doing nothing

@carlcsaposs-canonical
Copy link
Contributor Author

please create backlog ticket to add tests here.

opened #47

Copy link
Contributor

@paulomach paulomach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good cleanup

Comment on lines +47 to +56
shell: python
run: |
import pathlib
import subprocess

for rock_file in pathlib.Path(".").glob("*.rock"):
subprocess.run(
["syft", rock_file.name, "--output", f"spdx-json={rock_file.name}.spdx.json"],
check=True,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good ol shell?

Suggested change
shell: python
run: |
import pathlib
import subprocess
for rock_file in pathlib.Path(".").glob("*.rock"):
subprocess.run(
["syft", rock_file.name, "--output", f"spdx-json={rock_file.name}.spdx.json"],
check=True,
)
shell: bash
run: |
for rock_file in *.rock
do
syft "${rock_file}" --output spdx-json="${rock_file}".spdx.json
done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'll probably move to reusable workflows at some point

to keep consistent with postgres repo, not changing for now

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.

3 participants