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

Bump to new scionproto version #242

Merged
merged 10 commits into from
Oct 16, 2023

Conversation

martenwallewein
Copy link
Contributor

@martenwallewein martenwallewein commented Oct 10, 2023

Hey guys,

following the idea of this issue to update the scionproto dependency of scion-apps in another branch netsec-ethz/scion-apps#244

we need to update rains to this scionproto version, too. In this PR I updated all the SCION imports and resolved one minor migration issue. Building and testing (as far as it was possible on my machine) went well, so here is a first draft, let's see what the CI says.

Cheers,
Marten


This change is Reviewable

@martenwallewein martenwallewein changed the title Fix imports to new scionproto Bump to new scionproto version Oct 10, 2023
@sarcasticadmin
Copy link

Im was running into this as well.

I think it might be a good idea to leverage go 1.21 to match scion: scionproto/scion#4378

Regardless, building this branch against go 1.20 on linux results in a complete build and basic functionality of the binaries passes for me.

@martenwallewein
Copy link
Contributor Author

Good point, I upgraded to Go 1.21, so we're equal to scionproto.

@sarcasticadmin
Copy link

Latest changes to the branch work well from me with go 1.21 on linux, thanks @martenwallewein

@sarcasticadmin
Copy link

sarcasticadmin commented Oct 10, 2023

@martenwallewein one other thing I noticed when building locally was a big diff after building via make from go fmt, I think the existing CI check isnt failing:

make vet

It should probably be go fmt ./... | diff -u /dev/null - or something similar to return non-zero in the case of a diff inside the Makefile

@martenwallewein
Copy link
Contributor Author

I observed that same behaviour. I think this is because newer Go versions enforce different formatting. I skipped this intentionally in this PR because it touches nearly all files and would therefor hide the actual changes to the code.

I would suggest to split this in two PR's: This one for the go update, and I can do a second one adding your fixes and run go fmt over the code base, so we have the code properly formatted for newer Go versions, but this one will be probably quite big. What do you think @sarcasticadmin?

@sarcasticadmin
Copy link

@martenwallewein Absolutely agree with breaking it up into 2 PRs

@martenwallewein
Copy link
Contributor Author

Thanks! So it would be great if we can complete/merge this PR in the near future :)

@sarcasticadmin
Copy link

I'm not a maintainer, but hopefully they'll be able to look at this soon 🙂

@martenwallewein
Copy link
Contributor Author

Ah I see, then let's wait for further comments. But thanks for all the input so far! :)

Copy link
Member

@marcfrei marcfrei left a comment

Choose a reason for hiding this comment

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

Thanks a lot for looking into this @martenwallewein and @sarcasticadmin!

Reviewed 12 of 14 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions / 0 of 1 LGTMs obtained / 0 of 1 approvals obtained


.circleci/config.yml line 55 at r2 (raw file):

            # It should not matter if we build SCION binaries with different version than the apps
            # as long as there are no major breaks
            scion_commit=5883c725f748 # v0.6.1-0.20220202161514-5883c725f748

Running the following, original sequence of commands in my setup results also in scion_commit=5883c725f748:

scion_mod_version=$(go list -m github.com/scionproto/scion | sed -s 's/.*\s*=>\s*//')
scion_repo=https://${scion_mod_version% *}.git
scion_commit=${scion_mod_version##*[ -]}

Any idea why it is necessary to explicitly assign the commit here?


.circleci/config.yml line 97 at r2 (raw file):

       # Use different Go version to build scion-apps
      - run:
          name: Install Go 1.21.0 to build scion-apps

Why not go directly to the most recent version 1.21.3?

@martenwallewein
Copy link
Contributor Author

Thanks @marcfrei I will look into the comments!

@martenwallewein
Copy link
Contributor Author

Hey @marcfrei I can not find the button where to directly comment on the reviews (I guess the night was too short, sorry for this) but I guess it's fine to discuss it here:

  1. The topology generation and starting of all services won't work with the newest SCION version from the go.mod, because there was a lot of renaming and moving files ongoing in scionproto in the meantime. So the short term solution is to pin the scion version to the latest release which fits the integration test. The long term solution is to upgrade the integration test to the newest SCION version. However, this needs to be done in other repos too (at least scion-apps, scion-pathdiscovery, and maybe others) so it feels to me that it's a good idea to do this in one run for all of the repos. PS: I just saw that the comment in this line scion_commit=5883c725f748 # v0.6.1-0.20220202161514-5883c725f748 is quite confusing, it was just a backup. Hope this clarifies the version pinning.

  2. Updated to GO 1.21.3, now we are up to date!

@marcfrei
Copy link
Member

I can not find the button where to directly comment on the reviews

Ah sorry, I used Reviewable to comment on the PR. The button is just below your initial message for this PR at the top of #242

In case it's not showing up for you, does the following link work? https://reviewable.io/reviews/netsec-ethz/rains/242

@marcfrei
Copy link
Member

so it feels to me that it's a good idea to do this in one run for all of the repos. PS: I just saw that the comment in this line scion_commit=5883c725f748 # v0.6.1-0.20220202161514-5883c725f748 is quite confusing, it was just a backup. Hope this clarifies the version pinning.

I agree, we can stay on commit 5883c725f748 for now. My question then was, why we need to explicitly pin the version on line 56 when the original code

scion_mod_version=$(go list -m github.com/scionproto/scion | sed -s 's/.*\s*=>\s*//')
scion_repo=https://${scion_mod_version% *}.git
scion_commit=${scion_mod_version##*[ -]}

currently results in the same commit 5883c725f748. Is this to future-proof, in case the snippet above will yield a different commit ID?

@martenwallewein
Copy link
Contributor Author

I can not find the button where to directly comment on the reviews

Ah sorry, I used Reviewable to comment on the PR. The button is just below your initial message for this PR at the top of #242

In case it's not showing up for you, does the following link work? https://reviewable.io/reviews/netsec-ethz/rains/242

Wow, no no it was my fault, I was searching for a reply button in Reviewable but forgot to sign in with Github, so there was no reply button at all. I will follow up on the issues in Reviewable.

Copy link
Contributor Author

@martenwallewein martenwallewein left a comment

Choose a reason for hiding this comment

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

Reviewable status: 13 of 14 files reviewed, 2 unresolved discussions / 0 of 1 LGTMs obtained / 0 of 1 approvals obtained


.circleci/config.yml line 55 at r2 (raw file):

Previously, marcfrei (Marc Frei) wrote…

Running the following, original sequence of commands in my setup results also in scion_commit=5883c725f748:

scion_mod_version=$(go list -m github.com/scionproto/scion | sed -s 's/.*\s*=>\s*//')
scion_repo=https://${scion_mod_version% *}.git
scion_commit=${scion_mod_version##*[ -]}

Any idea why it is necessary to explicitly assign the commit here?

Following the discussion, I'm not sure if I'm doing something different than the CI script, but when I run these commands I get a different commit than the pinned one:

Code snippet:

➜  rains git:(feature/bump-scionproto) scion_mod_version=$(go list -m github.com/scionproto/scion | sed -s 's/.*\s*=>\s*//')
➜  rains git:(feature/bump-scionproto) scion_repo=https://${scion_mod_version% *}.git
➜  rains git:(feature/bump-scionproto) scion_commit=${scion_mod_version##*[ -]}
➜  rains git:(feature/bump-scionproto) echo $scion_commit
1774cbfccb4c

.circleci/config.yml line 97 at r2 (raw file):

Previously, marcfrei (Marc Frei) wrote…

Why not go directly to the most recent version 1.21.3?

Done :)

Copy link
Member

@marcfrei marcfrei left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed all commit messages.
Reviewable status: :shipit: complete! 1 of 1 LGTMs obtained


.circleci/config.yml line 55 at r2 (raw file):

Previously, martenwallewein (Marten Gartner) wrote…

Following the discussion, I'm not sure if I'm doing something different than the CI script, but when I run these commands I get a different commit than the pinned one:

Ah sorry, my fault this time -- I still used the old go.mod for the test above...

@marcfrei marcfrei merged commit 1e8d706 into netsec-ethz:master Oct 16, 2023
3 checks passed
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