-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add workspace packages #1892
Add workspace packages #1892
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
6298754
to
caf63fb
Compare
a698a03
to
bcfd702
Compare
Looking at some options to get the files on workspace VMs. The constraints are,
The good solutions I can see are,
Non-options,
Using anonymous access blob and http is nice for not needing authentication. However, you have to keep the manifest up to date which could be prone to error. Thoughts @jemrobinson @craddm |
Is the cloud-init Ansible support (https://cloudinit.readthedocs.io/en/latest/reference/modules.html#ansible) any help here? Some thoughts on your suggestions:
How/when would the file get updated? Is it reasonable to imagine e.g. an Azure Function that would do the updating? If so, perhaps it could write directly to the VM and you wouldn't need a storage volume at all? |
I do have some notes on SFTP, yes. Wasn't enormously tricky, IIRC. Creating a local user was easy through the portal, and seems from Powershell it was easy to create one with a password rather than an SSH key. I'm not seeing much about Azure Functions writing directly to VMs; you can trigger them on uploads to blob storage but so far I've only seen people suggest that the function copies files to a File Share |
@jemrobinson How much experience with key pairs in Azure/Pulumi do you have? Looks like your can't generate a local user with password using Pulumi (at least, the password isn't an output). |
What Pulumi resource are you using to generate a local user? I assume you don't mean in cloud-init? |
azure_native.storage.LocalUser Local user for SFTP, not for the workspaces. |
@jemrobinson Looks like Azure expects to keep the private key for keys in a keyvault. I think the best option would be to use the TLS package to generate a key, then store that as a secret. |
I'm still a bit confused about what advantage we get for using SFTP over one of the other options. Is it just that we can do so earlier in the cloud-init order of operations? If so, why does this matter? N.B. if you want to generate a Key in a Keyvault, I think you should probably use the Key resource |
The SFTP way means,
The current downside is it means sharing a private key between workspaces (or creating a new local account with key pair for each workspace). |
Also blob creation in the desired state account is failing on a fresh deployment:
|
I did see that serial console problem. I did a fresh deployment and it didn't occur again. I assumed it was some problem unrelated to the changes here. Haven't seen the azure-native Blob error. Looks like an authentication problem. My output above was from a fresh sre deployment at 226bebd. |
I think the blob issue is actually a Storage Account issue, where sometimes the network permissions on the storage account ("IP address A.B.C.D can access this account") don't translate into actually being able to access the account from that IP address. Worth moving this into its own issue as I don't think it's related to this PR. |
New deployment at 46af571, Pulumi ran without error, Ansible is now running on the workspace VM. |
Replicated serial console and guacamole login problems. #2028 is possibly causing guacamole login problems (redeployed Entra ID App doesn't have the correct token to authenticate with LDAP). # ldapsearch -H "ldap://identity.oda.daimyo.develop.turingsafehaven.ac.uk:1389"
ldap_sasl_interactive_bind: Protocol error (2)
additional info: LDAP search request failed. Failed to fetch bearer token from OAuth endpoint.
(unauthorized_client) AADSTS700016: Application with identifier 'd13c364d-992e-4ff2-8911-40c6646c82fd' was not found in the directory 'Turing Data Safe Haven (Green)'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant. Trace ID: 02613c3e-331e-4e2c-b034-1b317be65200 Correlation ID: 302e5952-a067-4456-95d8-4500577d0602 Timestamp: 2024-07-22 10:49:52Z |
For serial console issue, it may be a sporadic problem. I will try,
I would be surprised if it were cloudinit or Ansible (although I can't think what it is) as they shouldn't modify that user and using the portal password reset (either to change |
Some progress, I can log in to the serial console using the That would suggest there is something in cloud init/ansible that breaks the account. |
In a VM where I had a session,
|
Suspect it may be a PAM configuration issue. |
d382965
to
0fd9565
Compare
Before and after correcting
|
For reference, here's
Can you compare to the one deployed from this branch? |
@jemrobinson The same (now) 👍 |
0fd9565
to
30d9243
Compare
I can log into the serial console with these changes and #2034 fixes the Entra application issue. Looking into a problem with the apricot identity server. |
@JimMadge : Interactive login is now working (with the fix from #2034 applied) but I'm getting a prompt that needs sudo approval. Can we get ansible to do this or alternatively, remove it if it's not needed? ![]() There's a potential solution here: https://www.reddit.com/r/Ubuntu/comments/15stmwn/how_do_i_suppress_authentication_is_required_to/ but I haven't tested it. Captured in #2035 |
@jemrobinson Excellent, thanks for testing. I'm sure we had that error before and fixed in in v3-4. We should have a look in the old cloud-init, issues/PRs. Can we,
|
I've moved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with this. There are some remaining problems that have been pulled out into their own issues.
✅ Checklist
Enable foobar integration
rather than515 foobar
).develop
.🚦 Depends on
I have moved some, but not all desired state here.
There were some files templated in cloud-init which need data from Pulumi/configuration.
We can do that in Ansible, but we should think about how to we get the data to the workspaces.
There are some places where we could take advantage of the "official" Ansible community modules, or other packages from Ansible Galaxy. That will also require a bit of thought though as
ansible-galaxy
is really a package manager, so would be difficult to use in a locked down SRE.Further Work
🌂 Related issues
Closes #1574
🔬 Tests
Tested in a new deployment,