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

Create npm package for Node.js sdk #679

Closed
msannikov opened this issue Mar 28, 2019 · 27 comments · Fixed by #1356
Closed

Create npm package for Node.js sdk #679

msannikov opened this issue Mar 28, 2019 · 27 comments · Fixed by #1356
Labels
area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us!
Milestone

Comments

@msannikov
Copy link

No description provided.

@markmandel markmandel added help wanted We would love help on these issues. Please come help us! good first issue These are great first issues. If you are looking for a place to start, start here! area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc labels Mar 28, 2019
@rorygarand
Copy link
Contributor

I'll put in a PR for this. I'd really like to use npm for my project.

@rorygarand
Copy link
Contributor

Actually it looks like all that's really needed is access to Google's npm account. I'd love to help out if I can. Ping me if that's the case.

@markmandel
Copy link
Member

Could we / should we use https://github.blog/2019-05-10-introducing-github-package-registry/ ?

Or should we have our own npm package? (I've no idea about this ecosystem)

@rorygarand
Copy link
Contributor

Interesting. That would definitely work, but in my mind it's more a question of how Google handles (or wants to handle) packages they maintain.

I'm not sure if it matters to anyone at any level whether developers install agones via:

$ npm install @github/agones

vs.

$ npm install @google/agones

@markmandel
Copy link
Member

I think we could have an agones specific account - we don't necessarily need to have it tied to google itself.

@rorygarand
Copy link
Contributor

I'm agnostic about the approach. The github package registry is pretty neat but it is invite-only at the moment.

If adding to the npm registry is as simple as someone creating an account, I don't mind managing that.

Getting the project into either registry would make my life easier so let me know what I can do to help.

@markmandel
Copy link
Member

@thisisnotapril what's the common practice for this kind of thing? (storing account credentials for external repositories, etc?)

@rorygarand
Copy link
Contributor

rorygarand commented Dec 28, 2019

@markmandel @thisisnotapril any updates on this? i'm currently forking the repo so i can maintain my own registry through github with this as a package.

I wouldn't mind taking ownership of pushing to the googleforgames registry whenever there are version updates, since I'm already doing that anyways for myself, but I think I would need some access credentials to the repo that maybe you don't want to give to a rando off the internet.

I can also walk someone else through the process, or write something up etc. It's not terribly difficult but would make dev a little easier for my team. Currently we have to manually ensure we're all on the same version of agones locally before testing deployments.

@markmandel
Copy link
Member

Hey! We should totally do this. Let's push it to this repository.

What would be ideal for me 😄 is to have a Makefile target I can add to our release process.
Somewhere in here would likely be ideal:
https://github.com/googleforgames/agones/blob/master/build/includes/release.mk

Then I don't even need to know how NPM works! 😄

The tricky bit would be you would need to use the npm sdk image - but there is a run-sdk-command-node target that should make this quite easy!

I'm happy to do the part to integrate it into do-release part (since I usually test out releases anyway).

If you need to grab a Github token from the command line to authenticate, there is an example above as well.

Let me know if you need any help navigating the build system, either here or on Slack!

How does that sound?

@markmandel
Copy link
Member

I'll ask this question, since it's probably worth asking, since I've no idea about the node ecosystem.

Better to host the npm package on github or on npmjs? (Github is easier for us, as there is only 1 auth system to manage)

@rorygarand
Copy link
Contributor

That sounds perfect, I'll start on this right away.

I personally feel that npm vs github doesn't matter. The only problem this is solving for is keeping version numbers consistent across the team in a unified way.

markmandel added a commit that referenced this issue Jan 13, 2020
Adds a publish script to send the node sdk to the github package registry.

Related to: #679.

Co-authored-by: Mark Mandel <mark.mandel@gmail.com>
@rorygarand
Copy link
Contributor

@markmandel this can be closed now.

@markmandel markmandel added this to the 1.4.0 milestone Jan 22, 2020
@markmandel
Copy link
Member

Excellent point! Closed!

@phumberdroz
Copy link

phumberdroz commented Jan 23, 2020

I just wanted to integrate this but I have a couple of concerns.

My Plan was to publish a module for an existing game that other developers, that modify that game as well, can use.
My concern: every developer/machine(CI/CD) would now need to authenticate with GitHub to download this package and the package I would like to build.
This introduces a complexity that is currently not really common in open source JS.
See: Install from Github registry

The npm registry works without authentication and no need for manual settings.

Please consider publishing this into the NPM registry

@rorygarand
Copy link
Contributor

Agreed. I admit that when we started working on this, I had only published packages to github that were intended to be private. When it came to this project, I expected that authentication would not be required because this repo is public.

Now that the package is live I'm also experiencing the same sort of issue.

@markmandel I know this was just released, and I told you npm vs github didn't matter for the registry, but would this be something we could explore? There would be a couple of changes to what we just did but the overall build process would be the same.

@markmandel
Copy link
Member

That makes a lot of sense - sounds like I should setup a npm account for Agones? Probably setup an Agones org, yes?

@markmandel markmandel reopened this Jan 23, 2020
@phumberdroz
Copy link

phumberdroz commented Jan 23, 2020

You would want an NPM account and I would recommend to create an Org with that account to publish packages under that org.

@markmandel
Copy link
Member

@thisisnotapril should we do an Agones org, or a GoogleforGames org?

@thisisnotapril
Copy link
Collaborator

We have a Google org already; let's explore using that one.

@markmandel
Copy link
Member

markmandel commented Jan 23, 2020

That makes sense - likely @google-cloud/, such as https://www.npmjs.com/package/@google-cloud/vision

@markmandel
Copy link
Member

Also realised that https://github.com/googleforgames/agones/tree/master/examples/nodejs-simple is now broken, because it can't grab the package 😕

@phumberdroz
Copy link

Is this fixed?

Seems like there is a package now published under: https://www.npmjs.com/package/@googleforgames/agones

@markmandel
Copy link
Member

This is not fixed yet. I need to navigate our internal tooling. I'm most of the way there. I'll make sure to round this out before the next release.

@markmandel
Copy link
Member

https://www.npmjs.com/package/@googleforgames/agones

That is not an official release. @thisisnotapril we might want to look into this.

@markmandel
Copy link
Member

Just noticed the documentation is actually wrong:
https://agones.dev/site/docs/guides/client-sdks/nodejs/

We don't mention the package is on Github, not npm

@markmandel
Copy link
Member

https://www.npmjs.com/package/@google-cloud/agones-sdk

Check it out! Wanted to make sure this was in place for 1.4.0 RC release on Tuesday.

Updating the docs and example image 👍

markmandel added a commit to markmandel/agones that referenced this issue Feb 22, 2020
Made sense to do these two parts together, since they were intertwined.

1. Closed googleforgames#679 - create an interactive shell, so we can publish to
   @google-cloud/agones-sdk, since it requires some internal tools to
   make it happen.
2. Also update the Node version to 12.x, since 11.x is deprecated
3. Updated the image to use the new NPM package, and also while in there
   updated Node to 12.x and the Debian base to Buster.
4. Updated the release checklist to use the interactive shell, rather
   than the `publish` command, which has now been removed.
markmandel added a commit to markmandel/agones that referenced this issue Feb 22, 2020
Made sense to do these two parts together, since they were intertwined.

1. Closed googleforgames#679 - create an interactive shell, so we can publish to
   @google-cloud/agones-sdk, since it requires some internal tools to
   make it happen.
2. Also update the Node version to 12.x, since 11.x is deprecated
3. Updated the image to use the new NPM package, and also while in there
   updated Node to 12.x and the Debian base to Buster. (Node image
   update for googleforgames#1261)
4. Updated the release checklist to use the interactive shell, rather
   than the `publish` command, which has now been removed.
markmandel added a commit that referenced this issue Feb 22, 2020
Made sense to do these two parts together, since they were intertwined.

1. Closed #679 - create an interactive shell, so we can publish to
   @google-cloud/agones-sdk, since it requires some internal tools to
   make it happen.
2. Also update the Node version to 12.x, since 11.x is deprecated
3. Updated the image to use the new NPM package, and also while in there
   updated Node to 12.x and the Debian base to Buster. (Node image
   update for #1261)
4. Updated the release checklist to use the interactive shell, rather
   than the `publish` command, which has now been removed.
@phumberdroz
Copy link

Nice to see

markmandel added a commit that referenced this issue Feb 24, 2020
Made sense to do these two parts together, since they were intertwined.

1. Closed #679 - create an interactive shell, so we can publish to
   @google-cloud/agones-sdk, since it requires some internal tools to
   make it happen.
2. Also update the Node version to 12.x, since 11.x is deprecated
3. Updated the image to use the new NPM package, and also while in there
   updated Node to 12.x and the Debian base to Buster. (Node image
   update for #1261)
4. Updated the release checklist to use the interactive shell, rather
   than the `publish` command, which has now been removed.
markmandel added a commit that referenced this issue Feb 25, 2020
Made sense to do these two parts together, since they were intertwined.

1. Closed #679 - create an interactive shell, so we can publish to
   @google-cloud/agones-sdk, since it requires some internal tools to
   make it happen.
2. Also update the Node version to 12.x, since 11.x is deprecated
3. Updated the image to use the new NPM package, and also while in there
   updated Node to 12.x and the Debian base to Buster. (Node image
   update for #1261)
4. Updated the release checklist to use the interactive shell, rather
   than the `publish` command, which has now been removed.
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this issue Oct 23, 2020
Adds a publish script to send the node sdk to the github package registry.

Related to: googleforgames#679.

Co-authored-by: Mark Mandel <mark.mandel@gmail.com>
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this issue Oct 23, 2020
Made sense to do these two parts together, since they were intertwined.

1. Closed googleforgames#679 - create an interactive shell, so we can publish to
   @google-cloud/agones-sdk, since it requires some internal tools to
   make it happen.
2. Also update the Node version to 12.x, since 11.x is deprecated
3. Updated the image to use the new NPM package, and also while in there
   updated Node to 12.x and the Debian base to Buster. (Node image
   update for googleforgames#1261)
4. Updated the release checklist to use the interactive shell, rather
   than the `publish` command, which has now been removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants